Skip to content
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

DBItest causes warning on testthat 3rd edition (context() is deprecated) #263

Closed
MichaelChirico opened this issue Jul 26, 2022 · 2 comments · Fixed by #268
Closed

DBItest causes warning on testthat 3rd edition (context() is deprecated) #263

MichaelChirico opened this issue Jul 26, 2022 · 2 comments · Fixed by #268

Comments

@MichaelChirico
Copy link
Contributor

testthat::context() is deprecated in the 3rd edition, but it's always called here:

context(test_context)

Should that simply be escaped?

if (testthat::edition_get() < 3) context(test_context)

Or given the current version requirement on testthat, more robustly:

if (packageVersion("testthat") < "3.0.0" || testthat::edition_get() < 3) context(test_context)

Happy to file a PR for whatever's the desired behavior.

@krlmlr
Copy link
Member

krlmlr commented Jul 26, 2022

Thanks. I'm aware of that, and I'm not sure how to deal with it yet. Perhaps we need to make the descriptions in the generated calls to test_that() more verbose, so that they contain what previously was part of the context?

@MichaelChirico
Copy link
Contributor Author

isn't that done already?

test_that(paste0(test_context, ": ", test_name), {

@github-actions github-actions bot locked and limited conversation to collaborators Oct 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants