-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Handled CollectReport without duration attribute in terminal report #13573
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
base: main
Are you sure you want to change the base?
Handled CollectReport without duration attribute in terminal report #13573
Conversation
testing/test_terminal_report.py
Outdated
print(result.stderr.str()) | ||
|
||
combined = result.stdout.lines + result.stderr.lines | ||
assert any( |
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.
Not sure I follow, doesn't the change in terminal.py
prevents this message from appearing in the command line?
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 fix mainly prevents the AttributeError from showing up, which is expected now asthe bug is resolved.
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 the fact that the bug is fixed, means that the message does not show up, correct? any
is testing that it should show up, which is wrong.
testing/test_terminal_report.py
Outdated
from _pytest.pytester import Pytester | ||
|
||
|
||
def test_console_output_style_times_with_skipped_and_passed(pytester: Pytester) -> None: |
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.
Any reason why this test is not added to test_terminal.py
?
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.
Hi @nicoddemus , test_terminal.py was already existing,, so thought of making another new unit test file. Shall I add this in that existing file only? please let me know
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.
Yes please. 👍
Co-authored-by: Bruno Oliveira <[email protected]>
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Hi @nicoddemus , I made the necessary changes, please review and let me know. Thank you. |
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.
Thanks!
Fix #13478
This PR adds a regression test to fix a bug in console_output_style=times that, because it lacks the duration attribute, caused a crash when a CollectReport object (from a skipped test) was included. The test helps stop future regressions and verifies that the problem no longer exists.