diff --git a/tests/testthat/setup-options.R b/tests/testthat/setup-options.R index bea4d39e8..6c644735b 100644 --- a/tests/testthat/setup-options.R +++ b/tests/testthat/setup-options.R @@ -9,7 +9,7 @@ opts_partial_match_new <- list( warnPartialMatchAttr = TRUE ) -if (isFALSE(getFromNamespace("on_cran", "testthat")()) && require("withr")) { +if (isFALSE(getFromNamespace("on_cran", "testthat")()) && requireNamespace("withr", quietly = TRUE)) { withr::local_options( opts_partial_match_new, .local_envir = testthat::teardown_env()