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

Disable pytest captured logs #3036

Closed
wants to merge 1 commit into from
Closed

Disable pytest captured logs #3036

wants to merge 1 commit into from

Conversation

rakanalh
Copy link
Contributor

@rakanalh rakanalh commented Nov 15, 2018

It seems like pytest ignores showcapture and capture options when it prints the report for failed tests.
The problem that we're having right now is the fact that when we log stuff, pytest hooks it's own handlers into the test session to capture logs... in our code, our structured log instance prints the logs to stdout which makes the pytest also capture this output and therefore, resulting in two duplicate log lines being printed on failed tests (stdout + captured log record)

Resolves #3012

@LefterisJP
Copy link
Contributor

Doesn't seem to help with the Travis timeout though ... :(

@LefterisJP
Copy link
Contributor

Hmm I looked around a little and it seems that the --no-print-logs argument is going to be deprecated.

Have you tried to use --show-capture?

  --show-capture={no,stdout,stderr,log,all}          
                        Controls how captured stdout/stderr/log is shown on
                        failed tests. Default is 'all'.

@rakanalh
Copy link
Contributor Author

In the logging setup of the code we had an option with showcapture = false which didnt work... we also tried it in the pytest command arguments but didn't have the effect we wanted.

I'll double check what alternatives we have,

@rakanalh rakanalh closed this Nov 23, 2018
@rakanalh rakanalh deleted the pytest-captured-logs branch November 23, 2018 10:56
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

Successfully merging this pull request may close these issues.

None yet

2 participants