Skip to content

test: pin pytest<9.2 in failing handwritten packages - #18883

Merged
daniel-sanche merged 5 commits into
mainfrom
test/pin-pytest-below-9.2
Oct 28, 2026
Merged

daniel-sanche merged 5 commits into
mainfrom
test/pin-pytest-below-9.2

Conversation

@chalmerlowe

@chalmerlowe chalmerlowe commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Temporarily pin pytest<9.2 in the noxfile.py configuration of the 13 handwritten packages affected by the pytest 9.2.0 release.

Context

Upstream pytest 9.2.0 (released on October 27, 2026) changed warning filter initialization so that filterwarnings = error is applied before pytest_configure plugin hooks run, and removed the private FixtureManager._arg2fixturedefs attribute used by pytest-asyncio==0.21.2.

Pinning pytest<9.2 in the affected handwritten packages unblocks CI and current release pull requests (such as #18876). A follow-up effort will address pytest 9.2 compatibility across these packages cleanly.

Why These 13 Handwritten Packages Are Pinned

All 13 packages configure filterwarnings = error in pytest.ini or pyproject.toml and fall into two categories:

  1. Direct pytest-asyncio usage (10 packages): db-dtypes, google-api-core, google-auth-httplib2, google-cloud-dns, google-cloud-documentai-toolbox, google-cloud-error-reporting, google-cloud-firestore (also pins pytest-asyncio==0.21.2), google-cloud-logging, google-cloud-pubsub, and google-cloud-runtimeconfig. Each installs pytest-asyncio directly in its own noxfile.py alongside filterwarnings = error, causing pytest 9.2.0 to abort during startup when pytest-asyncio emits PytestDeprecationWarning for asyncio_default_fixture_loop_scope.

  2. Shared CI virtualenv inheritance (3 packages): google-cloud-core, google-cloud-testutils, and proto-plus. Although these three do not install pytest-asyncio in their own noxfile.py, our GitHub Actions test workflows reuse a shared Nox virtualenv directory (NOX_ENVDIR=/tmp/shared_nox_envs) across all packages in the same CI shard. When earlier packages in a shard install pytest-asyncio into that shared environment it will trigger the filterwarnings = error startup failure when these three packages run.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the 'noxfile.py' configuration files across multiple packages to pin the 'pytest' dependency to versions below 9.2 ('pytest<9.2'). This change affects unit tests, system tests, prerelease sessions, and core dependency installations. Additionally, a minor formatting adjustment was made in 'packages/google-cloud-testutils/noxfile.py' to add an empty line before imports. There are no review comments, and I have no feedback to provide.

@chalmerlowe
chalmerlowe marked this pull request as ready for review October 28, 2026 18:31
@chalmerlowe
chalmerlowe requested review from a team as code owners October 28, 2026 18:31
@chalmerlowe
chalmerlowe requested review from julianxu-goog and removed request for a team October 28, 2026 18:31
@daniel-sanche
daniel-sanche merged commit 2080127 into main Oct 28, 2026
119 checks passed
@daniel-sanche
daniel-sanche deleted the test/pin-pytest-below-9.2 branch October 28, 2026 19:11
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.

3 participants