Skip to content

ci: cap pytest below 9.2 for pytest-benchmark - #2781

Open
henryiii wants to merge 1 commit into
mainfrom
ci/cap-pytest-9.2
Open

henryiii wants to merge 1 commit into
mainfrom
ci/cap-pytest-9.2

Conversation

@henryiii

@henryiii henryiii commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

🤖 AI text below 🤖

pytest 9.2 removed Node._nodeid. pytest-benchmark 5.3.0 (latest) still uses it, so tests that use the benchmark fixture error at setup. This caps pytest below 9.2 until ionelmc/pytest-benchmark#321 is fixed in a release. Same as scikit-hep/particle#818 and scikit-hep/boost-histogram#1201.

I checked locally that the benchmark tests fail with pytest 9.2.0 and pytest-benchmark 5.3.0.

Summary by CodeRabbit

  • Chores
    • The supported version range for the test runner has been narrowed to keep automated checks within a defined range. This affects development and testing workflows only; it does not change application behavior or add user-facing features. No changes to the product’s functionality or experience are included in this update.

pytest 9.2 removed Node._nodeid, which pytest-benchmark 5.3.0 still uses.

Assisted-by: ClaudeCode:claude-opus-5-5
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: ac289518-3274-4cf3-a5f5-2601bcf7eac5
Commits

Reviewing files that changed from the base of the PR and between 0e92c36 and ac3644c.

Files selected for processing: 1
  • pyproject.toml

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

The pytest version range in the test dependency group and Pixi test feature is now >=8.4.0,<9.2.

Changes: Pytest version bounds

Layer / File(s) Summary
Test dependency constraints
pyproject.toml
Both test dependency declarations now cap pytest below version 9.2.

Priority: Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: matthewfeickert

Merge Risk: Minimal · up to ac364

The dependency cap consistently prevents the reported pytest-benchmark incompatibility.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: capping pytest below version 9.2 to maintain pytest-benchmark compatibility.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@henryiii

Copy link
Copy Markdown
Member Author

🤖 AI text below 🤖

Another option is the workaround from scikit-hep/mplhep#771. It does not cap pytest. A conftest.py hook copies item.nodeid to item._nodeid, so pytest-benchmark 5.3.0 works with pytest 9.2:

def pytest_collection_modifyitems(items):
    for item in items:
        if not hasattr(item, "_nodeid"):
            item._nodeid = item.nodeid

If you prefer that, I can change this PR to use it.

@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.30%. Comparing base (0e92c36) to head (ac3644c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2781   +/-   ##
=======================================
  Coverage   98.30%   98.30%           
=======================================
  Files          66       66           
  Lines        4372     4372           
  Branches      475      475           
=======================================
  Hits         4298     4298           
  Misses         46       46           
  Partials       28       28           
Flag Coverage Δ
contrib 98.19% <ø> (ø)
doctest 98.30% <ø> (ø)
unittests-3.10 96.52% <ø> (ø)
unittests-3.11 96.52% <ø> (ø)
unittests-3.12 96.52% <ø> (ø)
unittests-3.13 96.52% <ø> (ø)
unittests-3.14 96.52% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant