Skip to content

Commit

Permalink
Merge pull request #71 from r-world-devs/maciekbanas/57/use-withr-loc…
Browse files Browse the repository at this point in the history
…al_envar-for-controlling-verbose-in-tests

Add withr wrappers for verbose envar.
  • Loading branch information
maciekbanas authored Dec 11, 2024
2 parents 74a5cae + 0c7ab89 commit fe00850
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Imports:
rlang,
glue
Suggests:
testthat (>= 3.0.0)
testthat (>= 3.0.0),
withr
Config/testthat/edition: 3
Config/testthat/parallel: true
3 changes: 1 addition & 2 deletions tests/testthat/test-process_repos.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
test_that("process_repos() returns results with repo metadata", {
verbose_off()

withr::local_envvar(new = c("GITAI_VERBOSE" = FALSE))
my_project <- initialize_project("gitai_test_project") |>
set_github_repos(
repos = c("r-world-devs/GitStats", "openpharma/DataFakeR")
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-set_repos.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
test_that("set_*_repos creates GitStats object inside GitAI with repos set", {
verbose_off()
withr::local_envvar(new = c("GITAI_VERBOSE" = FALSE))
my_project <- initialize_project("gitai_test_project")

my_project <- my_project |>
Expand Down

0 comments on commit fe00850

Please sign in to comment.