Skip to content

Commit 8136eab

Browse files
committed
adapt test for easier debugging
1 parent 2c81480 commit 8136eab

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tests/testit/test-formats.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ test_format <- function(name, output_options = NULL, skip = NULL) {
1010
# work in a temp directory
1111
dir <- tempfile()
1212
dir.create(dir)
13-
oldwd <- setwd(dir)
14-
on.exit(setwd(oldwd), add = TRUE)
13+
withr::local_dir(dir)
1514

1615
# create a draft of the format
1716
testdoc <- paste0(name, "_article", ".Rmd")
@@ -24,7 +23,7 @@ test_format <- function(name, output_options = NULL, skip = NULL) {
2423
"Rendering the ", name, " format...",
2524
if (!is.null(output_options)) " (with output options)"
2625
)
27-
output_file <- rmarkdown::render(testdoc, output_options = output_options, quiet = TRUE)
26+
output_file <- rmarkdown::render(testdoc, output_options = output_options, quiet = !interactive())
2827
assert(paste(name, "format works"), {
2928
file.exists(output_file)
3029
})

0 commit comments

Comments
 (0)