-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
capsys interferes with debugging #128
Comments
Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt): this needs the introduction of a way to track sub-captures there is need for discussion with holger for an good approach currently capsys discards the output if you do not use it in the test |
Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42): you can try installation with "pip install -i http://pypi.testrun.org -U pytest", shoulkd give you 2.2.5.dev1 |
* Error if hostname not defined * Update CHANGES.md
Originally reported by: BitBucket: amcnabb8, GitHub: amcnabb8
I used capsys to test the output of a function that prints to stdout. The function failed before the capsys.readouterr() line, and its output was essential to determining what went wrong. The FAILURES list in py.test did not contain any of the output. It seems that in this situation, py.test should print all of the captured output in the FAILURES list, as it would if capsys were not present.
The following paste shows a minimal example with and without capsys:
http://paste.pocoo.org/show/560459
Note that for test_nocap, "hi" appears in the "captured stdout", but for test_capsys, this information is unavailable. It seems to me that "hi" should be shown for both cases.
Thanks for the work you put into pytest; it's a great project.
The text was updated successfully, but these errors were encountered: