diff --git a/DESCRIPTION b/DESCRIPTION index 36f62d305..5c738be09 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -41,7 +41,7 @@ Imports: Suggests: BiocManager (>= 1.30.18), callr (>= 3.7.1), - covr (>= 3.5.1), + covr (>= 4.0.0), curl (>= 4.3.2), digest (>= 0.6.29), DT (>= 0.23), diff --git a/NEWS.md b/NEWS.md index 30b509093..6e915f3a7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,6 @@ # devtools (development version) +* `test_coverage()` and `test_coverage_active_file()` no longer need DT for HTML reports with covr 4.0.0 or later, whose reports don't use it (@jimhester, #2712). * `test_active_file()` and `test_coverage_active_file()` now find the tests of Rust files in `src/rust/src/`, e.g. `test-lib.R` for `lib.rs`. With covr 4.0.0, `test_coverage_active_file()` also reports their coverage (@jimhester, #2711). * `submit_cran()` gives a more informative error when the CRAN submission form can't be used, suggesting that the user consult to see if there's a CRAN closure (#2700). * `check_built()` no longer prints `R_CHECK_` check env variables - now handled by `rcmdcheck::rcmdcheck()` directly as of r-lib/rcmdcheck#237 (#2621) diff --git a/R/test.R b/R/test.R index b60d02051..a179cb700 100644 --- a/R/test.R +++ b/R/test.R @@ -198,7 +198,10 @@ show_report <- function(coverage, report, path, call = caller_env()) { report <- report_default(report, call = call) if (report == "html") { - check_installed("DT") + # covr's reports only use DT before covr 4.0.0 + if (utils::packageVersion("covr") < "4.0.0") { + check_installed("DT") + } covered <- unique(covr::display_name(coverage)) if (length(covered) == 1) {