Closed eddelbuettel closed 2 years ago
One thing I'd definitely want from the solution is to mark omitted test cases as "skipped". However, this would require changing the relative positions of vcr::use_cassette()
and test_that()
, and I'm not yet sure how possible is that (hopefully there'll be no problems). I'll play with that in a moment.
Yes, I certainly have seen the skip_if_not_installed()
predicate in use for that, but only inside a testthat
block. Maybe you can shuffle the logic around to make that work. Maybe a simpler out testhat
block also around the 'tape restore' part is all it takes.
In fact, even HTTP testing in R includes vcr
inside test_that
:
If the checks pass, I think I'll merge it into devel branch (or wait for Dominik to double-check).
This is a slightly more 'risky' PR in the sense that I am not a regular user of
testthat
and certainly not ofvcr
which i don't even have installed -- so I cannot runR CMD check
here fordeepdep
which is mildly irritating. And, if we look closely at Writing R Extensions, incorrect. Suggested packaged should be used conditionally only.This PR does that with minimal changes to the test files. But again, from someone not using
testthat
so not sure if I broke some of the (many) (opinionated) rules here. But it now tests for me, and is one step forward.Feel free to nudge and adjust by pushing to this branch, or close it if you wildly disagree. The 'test only with Suggests: installed' issue does warrant some attention though (even if CRAN does not (yet?) enforce it it is slowly getting more attention).