-
-
Notifications
You must be signed in to change notification settings - Fork 612
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
Avoid spurious output during tests #1253
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1253 +/- ##
=======================================
Coverage 99.58% 99.59%
=======================================
Files 36 36
Lines 2923 2947 +24
Branches 332 333 +1
=======================================
+ Hits 2911 2935 +24
Misses 6 6
Partials 6 6
Continue to review full report at Codecov.
|
It is often convenient to use the pytest option "-s" (shortcut for --capture=no) to view one's own debugging print() output. When there is already lots of spurious output, it produces lots of noise and it may be difficult to view the intended debugging output. By avoiding unnecessary output, it is easier to find. Tests that have intentional output now assert that output. For example, the output of the sync command is now asserted. In addition to the advantage above, this creates a more robust test suite as the expected behavior is now more explicit, precise, and better covered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 👍
It is often convenient to use the pytest option "-s" (shortcut for
--capture=no) to view one's own debugging print() output. When there is
already lots of spurious output, it produces lots of noise and it may be
difficult to view the intended debugging output. By avoiding unnecessary
output, it is easier to find.
Tests that have intentional output now assert that output. For example,
the output of the sync command is now asserted. In addition to the
advantage above, this creates a more robust test suite as the expected
behavior is now more explicit, precise, and better covered.
Changelog-friendly one-liner:
Contributor checklist