Skip to content

Commit

Permalink
Convert to testthat 3e (#2426)
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley authored May 21, 2022
1 parent 371b9cc commit 047c91f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ Encoding: UTF-8
Language: en-US
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.0
Config/testthat/edition: 3
4 changes: 3 additions & 1 deletion tests/testthat/helper.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ create_local_package <- function() {
dir <- file_temp()

withr::defer(envir = parent.frame(), {
proj_set(old_project, force = TRUE)
usethis::ui_silence({
proj_set(old_project, force = TRUE)
})
setwd(old_wd)
dir_delete(dir)
})
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-install.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ expect_passes_args <- function(fn, stub, input_args = list(), expected_args) {
mck <- mockery::mock(NULL)
mockery::stub(fn, stub, mck)

suppressMessages(do.call(fn, input_args))
capture.output(suppressMessages(do.call(fn, input_args)))

mockery::expect_called(mck, 1)
mock_args <- mockery::mock_args(mck)[[1]]
Expand Down

0 comments on commit 047c91f

Please sign in to comment.