Skip to content

Commit

Permalink
do not handle warnings when option("warn") >= 2
Browse files Browse the repository at this point in the history
  • Loading branch information
yutannihilation committed Feb 24, 2018
1 parent 7f41a23 commit e132771
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/test-that.R
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ test_code <- function(test, code, env = test_env(), skip_on_empty = TRUE) {
invokeRestart("continue_test")
}
handle_warning <- function(e) {
# When options(warn) >= 2, a warning will be converted to an error.
# So, do not handle it here so that it will be handled by handle_error.
if (getOption("warn") >= 2) return()

handled <<- TRUE
e$expectation_calls <- frame_calls(11, 5)
register_expectation(e)
Expand Down

0 comments on commit e132771

Please sign in to comment.