Skip to content

Commit 5c8e9d1

Browse files
dgkfjimhester
authored andcommitted
hotfix for nested cov with record_tests=TRUE
1 parent 6f7163b commit 5c8e9d1

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

R/trace_tests.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ count_test <- function(key) {
8585
if (is_current_test_finished())
8686
update_current_test(key)
8787

88+
# ignore if .counter was not created with record_tests (nested coverage calls)
89+
if (is.null(.counters[[key]]$tests)) return()
90+
8891
depth_into_pkg <- length(sys.calls()) - .current_test$frame - n_calls_into_covr + 1L
8992
.counters[[key]]$tests <- rbind(
9093
.counters[[key]]$tests,

man/covr-package.Rd

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)