Closed mkirzon closed 4 years ago
progress turns off the progress bar by default in non-interactive sessions. See the force
argument and progress's own tests, e.g. https://github.com/r-lib/progress/blob/b146a6a74d14c1cf4a3689ae745a0c0f38a355d2/tests/testthat/test-progress.R#L6
Thank you so much... I can't believe I didn't realize that.
Summary
progress_bar
messages used within external packages have weird behavior when testthat unit tests are attempted by R CMD CHECK. I suspect environments are at play.More details
I made a package that leverages "progress". In my package, I have a function that uses
progress_bar
, which looks something like:Then to test my package, I use "testthat" and search for my custom progress messages using:
For some mysterious reason, these tests pass when run interactively with
devtools::test()
but fail when executed byR CMD CHECK
. The test output claims that my function "did not produce any messages" even though when run interactively, this works fine.I think this may be a convoluted issue so not sure how to create a reprex.