CodexGuild Knowledge Base
pytest 9: cleaned-up core, modern Python only
Canonical as of Jun 13, 2026
pytest 9: cleaned-up core, modern Python only
pytest 9.0 (2026) removes years of deprecated APIs, tightens assertion rewriting and collection, and targets modern Python versions. Most suites upgrade cleanly in minutes.
pytest 9
As of: 2026-06 (9.1.x)
What changed
- Deprecated APIs removed (
pytest.warns(None)-era leftovers, old hook signatures) — plugins pinned to 8.x behavior are the usual breakage; the ecosystem caught up within weeks. - Assertion rewriting improvements for clearer diffs; faster collection on very large suites.
- Modern Python support policy — newest 3.x lines prioritized; check the changelog matrix before pairing with a brand-new interpreter.
Upgrade checklist
pip install -U pytestthen run with-W error::DeprecationWarningonce.- Bump the plugin set together (pytest-asyncio, pytest-cov, xdist) — mixed majors cause cryptic hook errors.
- If a legacy plugin blocks you, stay on the 8.4.x line — it receives fixes; schedule the move after the plugin releases.