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

Print out return code, stdout and stderr output from the script on error #4

Closed
kvas-it opened this issue Nov 29, 2016 · 3 comments · Fixed by #25
Closed

Print out return code, stdout and stderr output from the script on error #4

kvas-it opened this issue Nov 29, 2016 · 3 comments · Fixed by #25

Comments

@kvas-it
Copy link
Owner

kvas-it commented Nov 29, 2016

No description provided.

@a96tudor
Copy link
Contributor

Hey! I'd like to work on this.
I just have a question: what do you mean by "error"? returncode != 0?

@kvas-it
Copy link
Owner Author

kvas-it commented Oct 16, 2018

Hey! Cool.

By "error" I mean "when the test fails". The idea is that in most cases, when the test fails it's useful to see what the script under test did and what it printed out. I find myself inserting print(result.stdout) and print(result.stderr) into the test quite often to get this information. It would be nice if pytest-console-scripts did it automatically (and would save me some typing and another test run).

We can actually print those things out all the time -- normally this output would be swallowed by capturing machinery of pytest but if the test fails we would see it.

@grant-humphries
Copy link

+1 for this feature, this is what I use as a work around the mean time:

assert result.success, result.stderr

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