Skip to content

Commit 0c6c11c

Browse files
authored
Fix bug with test_coverage_active_file() (#2680)
1 parent b07bfe5 commit 0c6c11c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

R/test.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ test_coverage_active_file <- function(
128128
pkg <- as.package(test_dir)
129129

130130
env <- load_all(pkg$path, quiet = TRUE, export_all = export_all)$env
131+
132+
# Must capture before local_test_directory() sets TESTTHAT envvar,
133+
# which causes rlang::is_interactive() to return FALSE
134+
report <- report_default(report)
135+
131136
# this always ends up using the package DESCRIPTION, which will refer
132137
# to the source package because of the load_all() above
133138
testthat::local_test_directory(test_dir, pkg$package)

0 commit comments

Comments
 (0)