You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes there are messages in tests, but they can be hard to locate, could there be an handling similar to how warnings are handled?
Warnings are easy to locate to go silence and / or add expect_warning() / suppressWarnings(), but you have to run tests one by one to find the source of a message.
Is there a way testthat could make that easier by giving the source of messages?
Possibly that to avoid messing with CI, and it is probably not that useful in CI, maybe just in Build Pane or in interactive sessions, where cli hyperlinks are quite handy to locate warnings!
Edit: maybe adding to tests/testthat/setup.R would work?
# Only on testing (not R CMD CHECK)if (!on_ci() &&!interactive() && Sys.getenv("RSTUDIO", "true") =="true"&&!Sys.getenv("R_CMD_CHECK", "true")) {
cli::cli_inform("Activated global entrace")
rlang::global_entrace()
}
The text was updated successfully, but these errors were encountered:
olivroy
changed the title
Accurate position of messages
Accurate position of messages in test log
Apr 12, 2024
Follow-up to this
#1459
Sometimes there are messages in tests, but they can be hard to locate, could there be an handling similar to how warnings are handled?
Warnings are easy to locate to go silence and / or add
expect_warning()
/suppressWarnings()
, but you have to run tests one by one to find the source of a message.Is there a way testthat could make that easier by giving the source of messages?
Possibly that to avoid messing with CI, and it is probably not that useful in CI, maybe just in Build Pane or in interactive sessions, where cli hyperlinks are quite handy to locate warnings!
Edit: maybe adding to
tests/testthat/setup.R
would work?The text was updated successfully, but these errors were encountered: