test() errors on unexpected output (#7847) - #7884
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7884 +/- ##
==========================================
- Coverage 99.02% 99.02% -0.01%
==========================================
Files 88 88
Lines 17376 17375 -1
==========================================
- Hits 17206 17205 -1
Misses 170 170 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Looks basically good, I'm only puzzled about the I'm not even sure why we have |
Sorry for the late reply. I just got back from vacation. I'll first try to explain my earlier comment more clearly. Based on my understanding,
What I'm attempting to add is a third case:
But this rule needs an exception under verbose. As far as I can tell there is no way to distinguish output produced by the tested expression from verbose diagnostics, so rule 3 would cause existing tests to fail. That's why I added Take verbose output for test 2.1Since rule 3 requires |
Closes #7847
test()now captures output and fails withTest <num> produced unexpected outputwhen a test produces output without using eitheroutput=ornotOutput=. Such output checking is skipped whendatatable.verbose=TRUE. To confirm this exception is necessary, I rantest.data.table(verbose=TRUE)manually. Without the exception, 4546 of 12876 tests failed on my machine:Error in test.data.table(verbose = TRUE) :With the exception, all 12876 tests pass.
This is my first pull request. I'd appreciate any suggestions or corrections.