Skip to content

build(deps): drop pytest-cases for pytest 9.1 - #279

Open
toby-coleman wants to merge 1 commit into
mainfrom
chore/drop-pytest-cases
Open

build(deps): drop pytest-cases for pytest 9.1#279
toby-coleman wants to merge 1 commit into
mainfrom
chore/drop-pytest-cases

Conversation

@toby-coleman

Copy link
Copy Markdown
Contributor

Summary

pytest-cases has not been updated for 6 months, and does not work with newer versions of pytest smarie/python-pytest-cases#385 and pytest-asyncio. This PR replaces it, using pytest-lazy-fixtures where required.

Changes

  • Remove pytest-cases
  • Update pytest and pytest-asyncio
  • Update tests where necessary.

pytest-cases 3.10.1 builds the private _pytest.python.IdMaker
positionally, so it fails to import under pytest 9.1, and its
SuperClosure prunes the fixture that pytest-asyncio 1.4 injects for
loop factories. Both upstream fixes are unreleased, so the test
extras were pinned below those versions.

The suite used pytest-cases only to reference a fixture from a
parametrisation. Fixture unions become plain parametrised fixtures
plus pytest-lazy-fixtures lf(), which resolves references through
public pytest APIs, so the pytest and pytest-asyncio bounds reopen.

The uvloop loop factory hook also takes effect for the first time:
pytest-asyncio 1.3 has no such hookspec, so the suite ran on the
default event loop. tests/unit/test_conftest.py now asserts the
running loop instead of the hook return value.

Refs smarie/python-pytest-cases#385
@github-actions

Copy link
Copy Markdown

Benchmark comparison for 78e8f549 (base) vs 8555e7d0 (PR)


------------------------------------------------------------------------------------------------------------------ benchmark: 2 tests -----------------------------------------------------------------------------------------------------------------
Name (time in ms)                                                                         Min                 Max                Mean            StdDev              Median               IQR            Outliers     OPS            Rounds  Iterations
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_benchmark_process_run (main/.benchmarks/Linux-CPython-3.14-64bit/0001_base)     543.7379 (1.0)      552.0260 (1.0)      546.4201 (1.0)      3.4445 (1.0)      545.1890 (1.0)      4.6461 (1.51)          1;0  1.8301 (1.0)           5           1
test_benchmark_process_run (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)         543.9373 (1.00)     552.4100 (1.00)     550.1646 (1.01)     3.5378 (1.03)     551.7915 (1.01)     3.0804 (1.0)           1;1  1.8176 (0.99)          5           1
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Legend:
  Outliers: 1 Standard Deviation from Mean; 1.5 IQR (InterQuartile Range) from 1st Quartile and 3rd Quartile.
  OPS: Operations Per Second, computed as 1 / Mean

@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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