-
Notifications
You must be signed in to change notification settings - Fork 241
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
Respect pytest --capture=no and -s flags #353
Respect pytest --capture=no and -s flags #353
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is beautiful @gnikonorov !
One small nitpick. 😊
Yes, you’re absolutely correct! I missed that the for-loop belonged to the outer if.
…On 21 Oct 2020, 15:15 +0200, Gleb Nikonorov ***@***.***>, wrote:
@gnikonorov commented on this pull request.
In pytest_html/plugin.py:
> - if report.longrepr:
- # longreprtext is only filled out on failure by pytest
- # otherwise will be None.
- # Use full_text if longreprtext is None-ish
- # we added full_text elsewhere in this file.
- text = report.longreprtext or report.full_text
- for line in text.splitlines():
- separator = line.startswith("_ " * 10)
- if separator:
- log.append(line[:80])
- else:
- exception = line.startswith("E ")
- if exception:
- log.append(html.span(raw(escape(line)), class_="error"))
+
+ if pytest_capture_value != "no":
I don't think we could do that, since this if also contains the for section in report.sections: block. We'd have to duplicate the statement then which is confusing IMO
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Bump for a review/merge @ssbarnea |
Hey @BeyondEvil if you are OK with this PR can you merge it in ( I'd rather not merge my own PRs, since I don't know how everyone else feels about them ). I'd like this in master so I can start work on the second half of #171, implementing support for |
Make
pytest-html
respect the--capture=no
and-s
pytest flags as requested in #171.Note that this only partially resolves the issue. We should also respect
--show-capture=no
, but I will add that in a follow up pr to make the changes smaller.