Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make tests fail, not print #312

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sneakers-the-rat
Copy link
Contributor

The output of the tests is pretty difficult to read, but there were lots of places that were saying "ERROR" without failing.

Looking further, it appears as if the default behavior for the TestEnvironment is to print, not fail on error.

There are also many print statements throughout the tests - raising an exception should be the print statement in tests.

This PR

  • Changes the default test behavior to fail on errors
  • Raises exceptions rather than logging when tests should fail
  • Removes all print statements from tests.

Don't print, raise.
Copy link

codecov bot commented Mar 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.75%. Comparing base (33ca663) to head (31a8ad0).
Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #312      +/-   ##
==========================================
- Coverage   62.92%   62.75%   -0.18%     
==========================================
  Files          62       61       -1     
  Lines        8545     8521      -24     
  Branches     2437     2437              
==========================================
- Hits         5377     5347      -30     
- Misses       2557     2560       +3     
- Partials      611      614       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sneakers-the-rat
Copy link
Contributor Author

The errors here are from comparisons being done to output files that don't exist - so the test is trivial, and the errors are correct, but should be conditioned on something like --generate-snapshots.

So we need to either:

  • remove tests or
  • add snapshots

The fact that the tests are failing on windows but the check appears to be passing in the gh interface indicates that the tests as currently configured don't actually alert us to failures (for windows). I assume that's from some weirdness in the way unittest deals with return codes, so we should switch to pytest ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant