-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fix issue where a new line was always written for the live log finish section #3194
Fix issue where a new line was always written for the live log finish section #3194
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.
Minor comments on my part, thanks @s0undt3ch!
_pytest/logging.py
Outdated
self.stream.write('\n') | ||
self._first_record_emitted = True | ||
elif self._when in ('teardown', 'finish'): | ||
if self._test_outcome_written is False: |
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.
It is considered more Pythonic to write if not self._test_outcome_written
instead.
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.
But less explicit. Personal habits...
I'll change.
testing/logging/test_reporting.py
Outdated
@@ -293,6 +294,62 @@ def test_log_2(fix): | |||
]) | |||
|
|||
|
|||
def test_sections_single_new_line_after_test_outcome(testdir, request): | |||
"""Check that with live logging enable we are printing the correct headers during |
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.
It seems this docstring is not related to the test
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.
yeah, copy/paste
aa70cc4
to
0f4092e
Compare
Updated. |
0f4092e
to
6491833
Compare
I tested out the branch and it works as advertised. 👍 Thanks a lot @s0undt3ch! |
6491833
to
d776e56
Compare
This is a fix for the feature PR #3189 where we'd always get 2 new lines between each log message on the finish section.
features
branch for new features and removals/deprecations.