Ability to capture stdout/stderr #404

k-bx opened this Issue Nov 30, 2013 · 7 comments


None yet
3 participants

k-bx commented Nov 30, 2013

Currently, lettuce doesn't capture stdout/stderr when running tests. I think it would be nice to do so.


gabrielfalcao commented Dec 2, 2013

What do you mean?
Could you show an example of how you idealize the usage of this feature?

k-bx commented Dec 2, 2013

Just as you do it in nose. Your prints are not shown, and only when your test fails it's printed as "captured stdout".

And you have option --nocapture that does what it says (current behavior).

Same for logging and --nologcapture


danni commented Feb 12, 2014

The reason prints aren't shown is they were getting overwritten by the coloured output. I have fixed this in the new-parser branch, and stdout and stderr should be correctly output for each step.

k-bx commented Feb 12, 2014

@danni that is great, thank you! I'll check out the branch.

k-bx commented Feb 12, 2014

@danni wait, I confused the issues (I thought you were referring to issue that last line is not shown in colored input).

What do you mean "prints aren't shown"? They are shown for me (all except last line). This issue report is to not show them (capture stdout and only show it for failed scenarios).


danni commented Feb 12, 2014

Oh. I see. I thought you were complaining about the truncation (that's always really annoyed me). The new outputter makes it really easy to just eat the output. Have a look at the code in #429 particularly plugins/colored_shell_output.py in print_step_ran() around line 145.

k-bx commented Feb 12, 2014

@danni yeah, truncation is annoying also, just not in this issue-report :) Anyway, thanks for work, I'll check it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment