-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
options for strict tests; few enhancements (#52)
- part of insightsengineering/coredev-tasks#478 - please read this for more info about the implementation: insightsengineering/coredev-tasks#478 (comment) --------- Co-authored-by: 27856297+dependabot-preview[bot]@users.noreply.github.com <27856297+dependabot-preview[bot]@users.noreply.github.com>
- Loading branch information
1 parent
12fa84c
commit 8dab731
Showing
2 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# `opts_partial_match_old` is left for exclusions due to partial matching in dependent packages (i.e. not fixable here) | ||
# it might happen that it is not used right now, but it is left for possible future use | ||
# use with: `withr::with_options(opts_partial_match_old, { ... })` inside the test | ||
opts_partial_match_old <- list( | ||
warnPartialMatchDollar = getOption("warnPartialMatchDollar"), | ||
warnPartialMatchArgs = getOption("warnPartialMatchArgs"), | ||
warnPartialMatchAttr = getOption("warnPartialMatchAttr") | ||
) | ||
opts_partial_match_new <- list( | ||
warnPartialMatchDollar = TRUE, | ||
warnPartialMatchArgs = TRUE, | ||
warnPartialMatchAttr = TRUE | ||
) | ||
|
||
if (isFALSE(getFromNamespace("on_cran", "testthat")()) && requireNamespace("withr", quietly = TRUE)) { | ||
withr::local_options( | ||
opts_partial_match_new, | ||
.local_envir = testthat::teardown_env() | ||
) | ||
} |