Additional newline when printing inside of a test #11064
Unanswered
MarcinKonowalczyk
asked this question in
Ideas
Replies: 1 comment 4 replies
-
IMHO, pytest monkey-patching Python built-ins by default is a big no-go. (and yes, it does that with |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What's the problem this feature will solve?
I, as i'm sure many others, sometimes use printing inside of the tests for quick debugging. The pattern is something like
pytest -k <my-specific-test> -s -x
(aka "run a subset of tests, don't capture prints and fail fast"). The issue is very minor: the prints look a bit ugly when in the middle of the pytest command-line output.Describe the solution you'd like / Alternative Solutions
I've come up with the following:
which gives
with
autose=False
we getShould purest do this by default?
Notes
-v
mode and same solution also works.-s
the patched prints don't fire, as expected.Beta Was this translation helpful? Give feedback.
All reactions