GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Handled CollectReport without duration attribute in terminal report by coder-aditi · Pull Request #13573 · pytest-dev/pytest

Conversation

@coder-aditi

@coder-aditi coder-aditi commented Jun 27, 2025

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
CoderAAA and others added 2 commits June 28, 2025 01:52
@CoderAAA
Handled CollectReport without duration attribute in terminal report
7c9cf56
@pre-commit-ci
[pre-commit.ci] auto fixes from pre-commit.com hooks
1ef62bc
for more information, see https://pre-commit.ci
nicoddemus
nicoddemus requested changes Jun 28, 2025
View reviewed changes
Comment thread testing/test_terminal_report.py Outdated
print(result.stderr.str())

combined = result.stdout.lines + result.stderr.lines
assert any(

@nicoddemus nicoddemus Jun 28, 2025

Copy link
Copy Markdown
Member

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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@coder-aditi coder-aditi Jun 28, 2025

Copy link
Copy Markdown
Contributor Author

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@nicoddemus nicoddemus Jun 28, 2025

Copy link
Copy Markdown
Member

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread testing/test_terminal_report.py Outdated
from _pytest.pytester import Pytester


def test_console_output_style_times_with_skipped_and_passed(pytester: Pytester) -> None:

@nicoddemus nicoddemus Jun 28, 2025

Copy link
Copy Markdown
Member

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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@coder-aditi coder-aditi Jun 28, 2025

Copy link
Copy Markdown
Contributor Author

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@nicoddemus nicoddemus Jun 28, 2025

Copy link
Copy Markdown
Member

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. 👍

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
nicoddemus
nicoddemus reviewed Jun 28, 2025
View reviewed changes
Comment thread testing/test_terminal_report.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

coder-aditi and others added 6 commits June 29, 2025 19:40
@coder-aditi @nicoddemus
Update testing/test_terminal_report.py
6adf54e
Co-authored-by: Bruno Oliveira <[email protected]>
@coder-aditi
Merge branch 'main' into fix/pytest_terminal_report_issue
d263824
@CoderAAA
Removed test_terminal_report.py from PR
aa02cab
@pre-commit-ci
[pre-commit.ci] auto fixes from pre-commit.com hooks
351b3f4
for more information, see https://pre-commit.ci
@coder-aditi
Updated test_terminal.py
9566c9f
@pre-commit-ci
[pre-commit.ci] auto fixes from pre-commit.com hooks
bb03a4b
for more information, see https://pre-commit.ci
@coder-aditi

coder-aditi commented Jun 29, 2025

Copy link
Copy Markdown
Contributor Author

Hi @nicoddemus , I made the necessary changes, please review and let me know. Thank you.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nicoddemus
Improve test and add CHANGELOG
25c8c0a
@pyba-chronographer pyba-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Jun 29, 2025
nicoddemus
nicoddemus approved these changes Jun 29, 2025
View reviewed changes

@nicoddemus nicoddemus left a comment

Copy link
Copy Markdown
Member

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!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nicoddemus nicoddemus added the backport 8.4.x label Jun 30, 2025
@nicoddemus
nicoddemus merged commit c5a75f2 into pytest-dev:main Jul 1, 2025
@patchback

patchback Bot commented Jul 1, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Backport to 8.4.x: 💚 backport PR created

✅ Backport PR branch: patchback/backports/8.4.x/c5a75f2498c86850c4ce13bcf10d56efc92394a4/pr-13573

Backported as #13579

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

patchback Bot pushed a commit that referenced this pull request Jul 1, 2025
@coder-aditi @CoderAAA
@nicoddemus @patchback
Fix crash with times output style and skipped module (#13573)
3e8a268
Fixes #13478

---------

Co-authored-by: AD <[email protected]>
Co-authored-by: Bruno Oliveira <[email protected]>
(cherry picked from commit c5a75f2)
@patchback patchback Bot mentioned this pull request Jul 1, 2025
[PR #13573/c5a75f24 backport][8.4.x] Handled CollectReport without duration attribute in terminal report #13579
Merged
nicoddemus added a commit that referenced this pull request Jul 1, 2025
@patchback @coder-aditi
@CoderAAA @nicoddemus
Fix crash with times output style and skipped module (#13573) (#13579)
f87289c
Fixes #13478

---------

(cherry picked from commit c5a75f2)

Co-authored-by: Aditi De <[email protected]>
Co-authored-by: AD <[email protected]>
Co-authored-by: Bruno Oliveira <[email protected]>
pull Bot pushed a commit to mergify-ci-insights/pytest that referenced this pull request Jul 16, 2025
@coder-aditi @CoderAAA
@nicoddemus @pull
Fix crash with times output style and skipped module (pytest-dev#13573
275b7df
)

Fixes pytest-dev#13478

---------

Co-authored-by: AD <[email protected]>
Co-authored-by: Bruno Oliveira <[email protected]>
@rennerdo30 rennerdo30 mentioned this pull request Oct 21, 2026
[Historical PR] chore(deps-dev): update pytest requirement from >=7.0.0 to >=8.4.2 rennerdo30/pdf-translator#12
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@nicoddemus nicoddemus nicoddemus approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Crash with console_output_style=times and skipping tests

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@coder-aditi @nicoddemus @CoderAAA
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.