Skip to content

Commit fbf53ae

Browse files
committed
add fix for skip outside test
1 parent dbe8883 commit fbf53ae

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# testthat (development version)
22

3+
* Fixed an issue where calling `skip()` outside of a test could cause
4+
an unexpected error (@kevinushey, #2038).
5+
36
# testthat 3.2.2
47

58
## New expectations

R/snapshot-reporter.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ SnapshotReporter <- R6::R6Class("SnapshotReporter",
116116
},
117117

118118
add_result = function(context, test, result) {
119-
if (is.null(self$test)) {
119+
if (!length(self$test)) {
120120
return()
121121
}
122122

0 commit comments

Comments
 (0)