From 0a83b6889148d3cae538911932ceb95290a2519b Mon Sep 17 00:00:00 2001 From: Markus <66058642+mhovd@users.noreply.github.com> Date: Wed, 16 Sep 2026 10:02:48 +0200 Subject: [PATCH] test: Skip R6 body check under covr `shipped example objects embed the current R6 method bodies` compares the bodies frozen in data/*.rda against the live R6 generators. covr rewrites every R6 method body in place when it instruments a package (covr:::traverse_R6), so the instrumented generator can never match the uninstrumented stored copy and the test-coverage workflow has failed on every run since the test was added in 6b50eee0. skip_on_covr() keeps the assertion running under R CMD check, where the bodies are not instrumented and the check does its real job. --- tests/testthat/test-data-currency.R | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/testthat/test-data-currency.R b/tests/testthat/test-data-currency.R index 0af10ad16..8bc64149c 100644 --- a/tests/testthat/test-data-currency.R +++ b/tests/testthat/test-data-currency.R @@ -97,6 +97,13 @@ test_that("shipped example objects expose the current R6 members", { }) test_that("shipped example objects embed the current R6 method bodies", { + # covr::package_coverage() instruments every R6 method body in place + # (covr:::traverse_R6), so the live generator can never match the + # uninstrumented bodies frozen in data/*.rda. The member-set test above + # is unaffected because instrumentation preserves method names, and this + # check still runs for real under R CMD check. + skip_on_covr() + objects <- shipped_r6_objects() problems <- character()