Skip to content

test: focus pytest summary on unexpected failures - #2203

Open
raisulchowdhury wants to merge 2 commits into
gitpython-developers:mainfrom
raisulchowdhury:codex-1891-pytest-summary
Open

test: focus pytest summary on unexpected failures#2203
raisulchowdhury wants to merge 2 commits into
gitpython-developers:mainfrom
raisulchowdhury:codex-1891-pytest-summary

Conversation

@raisulchowdhury

Copy link
Copy Markdown

Summary

  • Use pytest failure/error summary modes instead of listing every expected failure.
  • Keep aggregate failure, error, xfail, and skip counts available while making unexpected failures prominent.

Fixes #1891

Validation

  • Reproduced the baseline and candidate output with an isolated pytest fixture containing one expected failure and one unexpected failure.
  • git diff --check

The full GitPython suite was not run because its setup script mutates repository branches, tags, and reflogs; the focused reporter fixture directly exercises this configuration change.

Assisted-by: OpenAI Codex. AI assistance was used for investigation and implementation; the submitted diff and validation were reviewed before publication.

Use pytest's failure and error summary modes so expected-failure details do not obscure unexpected failures while retaining aggregate counts.

Assisted-by: OpenAI Codex
Signed-off-by: raisulchowdhury <34920788+raisulchowdhury@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 1, 2026 05:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the project’s pytest default options to reduce verbose reporting of expected failures (xfail) so CI output makes unexpected failures easier to spot, addressing #1891.

Changes:

  • Switch pytest “extra summary” flags from -ra (all non-passing, including xfail details) to -rfE (failures + errors only).
  • Adjust the inline comment describing the summary mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml Outdated

[tool.pytest.ini_options]
addopts = "--cov=git --cov-report=term -ra"
addopts = "--cov=git --cov-report=term -rfE"
Comment thread pyproject.toml Outdated
# --cov-report html:path # html file at path
# --maxfail # number of errors before giving up
# -rfE # default test summary: list fail and error
# -rfE # test summary: list failures and errors, omitting expected failures

@Byron Byron left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I do, however, think that the copilot comment should be looked into.

Include XPASS results while still omitting expected-failure detail, and document the exact report flags.\n\nAssisted-by: OpenAI Codex

Signed-off-by: raisulchowdhury <34920788+raisulchowdhury@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 1, 2026 14:42
@raisulchowdhury

Copy link
Copy Markdown
Author

Addressed the review request in commit 1d246f0:

  • Changed the report flags from -rfE to -rfEX so non-strict XPASS results remain visible while expected-failure details stay suppressed.
  • Updated the inline comment to describe the exact flags.
  • Rechecked the focused pytest reporter fixture with failed, xfailed, and xpassed cases.

Assisted-by: OpenAI Codex. The change and validation were reviewed before pushing.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@raisulchowdhury

Copy link
Copy Markdown
Author

The Copilot points are addressed in 1d246f0: the report now uses -rfEX, and the inline comment documents the exact flags and their behavior. Both inline threads are now outdated. Could you re-review the updated commit when convenient?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Detailed xfail output sometimes distracts from unexpected failures

3 participants