Skip to content

chore(test): upgrade pytest 8→9 for GHSA-6w46-j5rx-g56g#478

Merged
haksungjang merged 2 commits into
mainfrom
chore/pytest-9-upgrade
Jul 8, 2026
Merged

chore(test): upgrade pytest 8→9 for GHSA-6w46-j5rx-g56g#478
haksungjang merged 2 commits into
mainfrom
chore/pytest-9-upgrade

Conversation

@haksungjang

Copy link
Copy Markdown
Contributor

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):

pytest         8.3.4  -> 9.0.3
pytest-asyncio 0.24.0 -> 1.4.0
pytest-cov     6.0.0  -> 7.1.0

Plus asyncio_default_fixture_loop_scope = "function" in pyproject.toml: pytest-asyncio 1.x makes the async-fixture loop scope configurable and warns when unset. function preserves the per-test loop behaviour the suite already ran under with 0.24 (the root _isolate_engine_per_test autouse fixture is function-scoped), so the upgrade is behaviour-preserving.

Verification

  • 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 (minimal repro).
  • 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 three things that most often break this upgrade.
  • The full DB-backed suite is validated by CI 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).

…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)`.
@haksungjang haksungjang merged commit 91c4340 into main Jul 8, 2026
20 checks passed
@haksungjang haksungjang deleted the chore/pytest-9-upgrade branch July 8, 2026 12:31
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