chore(test): upgrade pytest 8→9 for GHSA-6w46-j5rx-g56g#478
Merged
Conversation
…6-j5rx-g56g Closes the deferred dev-tooling advisory from the Dependabot sweep: pytest's tmpdir handling (GHSA-6w46-j5rx-g56g) is fixed in 9.0.3. Moving to pytest 9 pulls two compatible majors (pip-resolved): pytest 8.3.4 -> 9.0.3 pytest-asyncio 0.24.0 -> 1.4.0 pytest-cov 6.0.0 -> 7.1.0 pytest-asyncio 1.x makes the async-fixture event-loop scope configurable and warns when unset, so pin `asyncio_default_fixture_loop_scope = "function"` in pyproject.toml — that preserves the per-test loop behaviour the suite ran under with 0.24 (the root `_isolate_engine_per_test` autouse fixture is already function-scoped), keeping the upgrade behaviour-preserving. Verified locally: clean pip resolution of the three-package set; `asyncio_mode = "auto"` still auto-collects async tests and `--cov` still reports under 9.0.3 / 1.4.0 / 7.1.0; the suite has no `event_loop` fixture override (removed in asyncio 1.x), no module/session-scoped async fixtures, and no warnings-as-errors config. The full DB-backed suite is validated by CI `test (backend)`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The last remaining actionable Dependabot alert from the dependency sweep: pytest's tmpdir advisory (GHSA-6w46-j5rx-g56g), fixed in 9.0.3. It was deferred out of PR #476 because the fix is a major bump that could break the test suite — this PR carries it on its own so any breakage is isolated.
Moving to pytest 9 pulls two compatible majors (pip-resolved):
Plus
asyncio_default_fixture_loop_scope = "function"inpyproject.toml: pytest-asyncio 1.x makes the async-fixture loop scope configurable and warns when unset.functionpreserves the per-test loop behaviour the suite already ran under with 0.24 (the root_isolate_engine_per_testautouse fixture is function-scoped), so the upgrade is behaviour-preserving.Verification
asyncio_mode = "auto"still auto-collects async tests and--covstill reports under 9.0.3 / 1.4.0 / 7.1.0 (minimal repro).event_loopfixture override (removed in asyncio 1.x), no module/session-scoped async fixtures, and no warnings-as-errors config — the three things that most often break this upgrade.test (backend); this PR should not be merged unless that job is green.Result
Clears the pytest advisory. After merge, the only remaining open Dependabot alert is weasyprint (no upstream patch available — kept open as a tracker).