Skip to content

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

Merged
henryiii merged 1 commit into
mainfrom
ci/cap-pytest
Oct 28, 2026
Merged

henryiii merged 1 commit into
mainfrom
ci/cap-pytest

Conversation

@henryiii

@henryiii henryiii commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Worrisome this has persisted for a bit without response, if it continues we might need to look for alternatives.

🤖 AI text below 🤖

pytest 9.2 removed Node._nodeid. pytest-benchmark 5.3.0 (latest) still uses it, so the benchmark tests error (see CI on #817). This caps pytest below 9.2 in the dev and test extras until ionelmc/pytest-benchmark#321 is fixed in a release.

pytest 9.2 removed Node._nodeid, which pytest-benchmark 5.3.0 uses.
See ionelmc/pytest-benchmark#321.

Assisted-by: ClaudeCode:claude-opus-5-5
@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 95.31%. Comparing base (402f2b0) to head (f7323b8).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #818   +/-   ##
=======================================
  Coverage   95.31%   95.31%           
=======================================
  Files          32       32           
  Lines        1410     1410           
=======================================
  Hits         1344     1344           
  Misses         66       66           

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

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

@eduardo-rodrigues eduardo-rodrigues added CI dependencies Pull requests that update a dependency file labels Oct 28, 2026

@eduardo-rodrigues eduardo-rodrigues 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.

Hi @henryiii, thank you for spotting the issue and fixing it on the fly.

I'm fine with the cap and will then proceed with my major update tomorrow. Happy to see this merged. Many thanks.

@henryiii
henryiii merged commit daa7009 into main Oct 28, 2026
19 checks passed
@henryiii
henryiii deleted the ci/cap-pytest branch October 28, 2026 22:14
ikrommyd pushed a commit to scikit-hep/numba-stats that referenced this pull request Oct 29, 2026
🤖 _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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants