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

Capture output from unittest tests #5

Closed
kondratyev-nv opened this issue Sep 10, 2018 · 6 comments
Closed

Capture output from unittest tests #5

kondratyev-nv opened this issue Sep 10, 2018 · 6 comments

Comments

@kondratyev-nv
Copy link
Owner

Now when running unittest tests only result of a test is captured from a TestResult of failed and skipped tests.
For a debug purpose it would be great to capture stdout from tests.

@darkvertex
Copy link

When running stuff from pytest, the -s flag will disable all capturing (silencing) during execution, thus prints and such will make it during execution.

It's quite tricky to know which output is from what test though. The easiest way would be to open the output of the last test run.

@jamescasbon
Copy link

One possibility is to use the junitxml output which contains all this information in a structured format.

@yozlet
Copy link

yozlet commented Dec 15, 2018

This would also be great for pytest tests. Right now there's only a one-line error, without any further context. This is particularly frustrating given that pytest often gives useful explanations of test failures, but they're not shown.

@kondratyev-nv
Copy link
Owner Author

@yozlet JFYI, output capturing for pytest was added in version 0.2.6.

@yozlet
Copy link

yozlet commented Jan 22, 2019

@kondratyev-nv Yep, I noticed. Thank you! With that and fixing test discovery for pytest 4.1.x, you've removed the two blockers that were keeping me on the command line.

@kondratyev-nv
Copy link
Owner Author

The unittest output capturing was added in version 0.3.0, so this issue can be closed.

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

No branches or pull requests

4 participants