Open
Description
Updating to 3.2.3 broke some tests. The biggest thing was usage like this:
Sys.setenv(TESTTHAT_EDITION=3)
expect_error(stop("hello"), msg="bye")
### 3.2.1.1
# Warning message:
# In expect_error(stop("hello"), msg = "bye") :
# Arguments in `...` must be used.
# ✖ Problematic argument:
# • msg = "hello"
# ℹ Did you misspell an argument name?
### 3.2.3
# Error in `expect_error()`:
# ! Can't specify `...` without `pattern`.
# Run `rlang::last_trace()` to see where the error occurred.
Previously, the tests would pass somewhat spuriously, as in effect the msg
argument is totally ignored, i.e. it's equivalent to just running expect_error(stop("hello"))
which only checks the condition is thrown, not its contents.
The change in 3.2.3 is definitely for the better (this flushed out some tests checking for the wrong message), but the old warning was clearer & more actionable. Even putting aside #2053, it's hard to tie together "...
is specified" means "some named argument didn't match formals --> wound up passing to ...
". Simply restoring the informative "problematic argument" tag would do a lot.
Metadata
Metadata
Assignees
Labels
No labels