-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expect_message()
and expect_warning()
do not check class
in testthat 2e?
#1894
Comments
mikemahoney218
changed the title
Nov 7, 2023
expect_message()
and expect_warning()
do not check class
?expect_message()
and expect_warning()
do not check class
in testthat 2e?
This is only in edition 2: library(testthat)
testthat::local_edition(3)
try(
expect_message(message(), class = "not a match")
)
#>
#> Error : `message()` did not throw the expected message.
try(
expect_warning(warning(), class = "not a match")
)
#> Warning in eval_bare(quo_get_expr(.quo), quo_get_env(.quo)):
#> Error : `warning()` did not throw the expected warning. Created on 2023-11-07 with reprex v2.0.2 |
Is this is a regression? |
I'm not sure, sorry. It exists in both CRAN and dev versions so it's not a recent one. |
Yeah, I think this might be a long standing bug. |
And since it's in the second edition, I'm not going to fix it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi all,
With current HEAD (5659da8) it seems like
expect_message()
andexpect_warning()
succeed even if the condition does not have classclass
. This is not the case forexpect_condition()
orexpect_error()
.Is this expected?
Created on 2023-11-07 with reprex v2.0.2
Session info
The text was updated successfully, but these errors were encountered: