Skip to content

Commit

Permalink
add fix for skip outside test
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinushey committed Dec 11, 2024
1 parent dbe8883 commit fbf53ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# testthat (development version)

* Fixed an issue where calling `skip()` outside of a test could cause
an unexpected error (@kevinushey, #2038).

# testthat 3.2.2

## New expectations
Expand Down
2 changes: 1 addition & 1 deletion R/snapshot-reporter.R
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ SnapshotReporter <- R6::R6Class("SnapshotReporter",
},

add_result = function(context, test, result) {
if (is.null(self$test)) {
if (!length(self$test)) {
return()
}

Expand Down

0 comments on commit fbf53ae

Please sign in to comment.