testthat
testthat copied to clipboard
local_mocked_bindings shows different behaviour devtools::test() vs command line , github, devtools::check
Using local_mocked_bindings() helped me to finally to solve a thorny testing of a function that used utils::askYesNo. So very impressed overall.
But, I found that it worked as expected in most cases (running on command line an individual test, using devtools::check, on a github action with covr::package_coverage) .
But when I used devtools::test(), it would still show the dialogue and need me to hit return. More curiously, even though I ran two tests (for when I say "Yes" and "No"), the dialogue only appeared once, and I only hit return once.
This might actually be desirable behaviour, but needs some more documentation and explanation.