chore(deps-dev): bump pytest from 8.4.2 to 9.0.2#1592
chore(deps-dev): bump pytest from 8.4.2 to 9.0.2#1592dependabot[bot] wants to merge 1 commit intomainfrom
Conversation
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.4.2 to 9.0.2. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](pytest-dev/pytest@8.4.2...9.0.2) --- updated-dependencies: - dependency-name: pytest dependency-version: 9.0.2 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
| { name = "pygments" }, | ||
| { name = "tomli", marker = "python_full_version < '3.11'" }, | ||
| ] | ||
| sdist = { url = "https://files.pythonhosted.org/packages/a3/5c/00a0e072241553e1a7496d638deababa67c5058571567b92a7eaa258397c/pytest-8.4.2.tar.gz", hash = "sha256:86c0d0b93306b961d58d62a4db4879f27fe25513d4b969df351abdddb3c30e01", size = 1519618, upload-time = "2025-09-04T14:34:22.711Z" } | ||
| sdist = { url = "https://files.pythonhosted.org/packages/d1/db/7ef3487e0fb0049ddb5ce41d3a49c235bf9ad299b6a25d5780a89f19230f/pytest-9.0.2.tar.gz", hash = "sha256:75186651a92bd89611d1d9fc20f0b4345fd827c41ccd5c299a868a05d70edf11", size = 1568901, upload-time = "2025-12-06T21:30:51.014Z" } | ||
| wheels = [ | ||
| { url = "https://files.pythonhosted.org/packages/a8/a4/20da314d277121d6534b3a980b29035dcd51e6744bd79075a6ce8fa4eb8d/pytest-8.4.2-py3-none-any.whl", hash = "sha256:872f880de3fc3a5bdc88a11b39c9710c3497a547cfa9320bc3c5e62fbf272e79", size = 365750, upload-time = "2025-09-04T14:34:20.226Z" }, | ||
| { url = "https://files.pythonhosted.org/packages/3b/ab/b3226f0bd7cdcf710fbede2b3548584366da3b19b5021e74f5bde2a8fa3f/pytest-9.0.2-py3-none-any.whl", hash = "sha256:711ffd45bf766d5264d487b917733b453d917afd2b0ad65223959f59089f875b", size = 374801, upload-time = "2025-12-06T21:30:49.154Z" }, | ||
| ] | ||
|
|
||
| [[package]] | ||
| name = "pytest-asyncio" | ||
| version = "1.1.1" | ||
| version = "0.23.3" | ||
| source = { registry = "https://pypi.org/simple" } | ||
| dependencies = [ | ||
| { name = "backports-asyncio-runner", marker = "python_full_version < '3.11'" }, | ||
| { name = "pytest" }, | ||
| ] | ||
| sdist = { url = "https://files.pythonhosted.org/packages/8d/1e/2aa43805d4a320a9489d2b99f7877b69f9094c79aa0732159a1415dd6cd4/pytest_asyncio-1.1.1.tar.gz", hash = "sha256:b72d215c38e2c91dbb32f275e0b5be69602d7869910e109360e375129960a649", size = 46590, upload-time = "2025-09-12T06:36:20.834Z" } | ||
| sdist = { url = "https://files.pythonhosted.org/packages/1d/27/f036ec4bcbfd056c54572d7169ba3dbb54e7181f02f21caadd3aecb9cf5b/pytest-asyncio-0.23.3.tar.gz", hash = "sha256:af313ce900a62fbe2b1aed18e37ad757f1ef9940c6b6a88e2954de38d6b1fb9f", size = 44841, upload-time = "2024-01-01T14:03:58.77Z" } | ||
| wheels = [ | ||
| { url = "https://files.pythonhosted.org/packages/28/de/aba79e9ccdb51b5d0d65c67dd857bd78b00c64723df16b9fc800d8b94ce6/pytest_asyncio-1.1.1-py3-none-any.whl", hash = "sha256:726339d30fcfde24691f589445b9b67d058b311ac632b1d704e97f20f1d878da", size = 14719, upload-time = "2025-09-12T06:36:19.726Z" }, | ||
| { url = "https://files.pythonhosted.org/packages/1d/d6/568f370599c794cc97e2f36293e06ee9bd5bd3a2d2eb62525671425d266b/pytest_asyncio-0.23.3-py3-none-any.whl", hash = "sha256:37a9d912e8338ee7b4a3e917381d1c95bfc8682048cb0fbc35baba316ec1faba", size = 17383, upload-time = "2024-01-01T14:03:56.293Z" }, | ||
| ] |
There was a problem hiding this comment.
pytest-asyncio unexpectedly downgraded from 1.1.1 → 0.23.3
As a side-effect of bumping pytest to 9.0.2, the lock file resolves pytest-asyncio from 1.1.1 (released Sep 2025) all the way down to 0.23.3 (released Jan 2024). This happens because pytest-asyncio 1.x appears to carry a dependency constraint that makes it incompatible with pytest 9.x, so uv's resolver falls back to the highest 0.x release that satisfies the >=0.21.1,<1.2.0 bound.
This is a ~20-month regression in pytest-asyncio and brings several potential concerns:
- Deprecation warnings in
pytest-asyncio0.21–0.23 whenasyncio_modeis not set in[tool.pytest.ini_options]— the project currently has noasyncio_modeentry, which will produceFutureWarningnoise in CI output. - Any test helpers or fixtures that relied on
pytest-asyncio1.x behaviour (e.g. the reworkedevent_loopfixture, scoped loop support) will silently regress. backports-asyncio-runner(previously a transitive dep for Python < 3.11) is also removed, which is fine given the project requires Python ≥ 3.10, but is worth being aware of.
Suggested action: Update the pyproject.toml constraint to pytest-asyncio>=0.21.1,<0.25 (or whichever latest 0.x release is pytest-9-compatible and verified against the test suite), or investigate whether a newer pytest-asyncio release (e.g. >=1.2.0) adds explicit pytest 9 support, and adjust the upper bound accordingly. Either way, the downgrade should be an explicit, intentional choice rather than a silent resolver artifact.
| { name = "pygments" }, | ||
| { name = "tomli", marker = "python_full_version < '3.11'" }, | ||
| ] | ||
| sdist = { url = "https://files.pythonhosted.org/packages/a3/5c/00a0e072241553e1a7496d638deababa67c5058571567b92a7eaa258397c/pytest-8.4.2.tar.gz", hash = "sha256:86c0d0b93306b961d58d62a4db4879f27fe25513d4b969df351abdddb3c30e01", size = 1519618, upload-time = "2025-09-04T14:34:22.711Z" } | ||
| sdist = { url = "https://files.pythonhosted.org/packages/d1/db/7ef3487e0fb0049ddb5ce41d3a49c235bf9ad299b6a25d5780a89f19230f/pytest-9.0.2.tar.gz", hash = "sha256:75186651a92bd89611d1d9fc20f0b4345fd827c41ccd5c299a868a05d70edf11", size = 1568901, upload-time = "2025-12-06T21:30:51.014Z" } | ||
| wheels = [ | ||
| { url = "https://files.pythonhosted.org/packages/a8/a4/20da314d277121d6534b3a980b29035dcd51e6744bd79075a6ce8fa4eb8d/pytest-8.4.2-py3-none-any.whl", hash = "sha256:872f880de3fc3a5bdc88a11b39c9710c3497a547cfa9320bc3c5e62fbf272e79", size = 365750, upload-time = "2025-09-04T14:34:20.226Z" }, | ||
| { url = "https://files.pythonhosted.org/packages/3b/ab/b3226f0bd7cdcf710fbede2b3548584366da3b19b5021e74f5bde2a8fa3f/pytest-9.0.2-py3-none-any.whl", hash = "sha256:711ffd45bf766d5264d487b917733b453d917afd2b0ad65223959f59089f875b", size = 374801, upload-time = "2025-12-06T21:30:49.154Z" }, | ||
| ] | ||
|
|
||
| [[package]] | ||
| name = "pytest-asyncio" | ||
| version = "1.1.1" | ||
| version = "0.23.3" | ||
| source = { registry = "https://pypi.org/simple" } | ||
| dependencies = [ | ||
| { name = "backports-asyncio-runner", marker = "python_full_version < '3.11'" }, | ||
| { name = "pytest" }, | ||
| ] | ||
| sdist = { url = "https://files.pythonhosted.org/packages/8d/1e/2aa43805d4a320a9489d2b99f7877b69f9094c79aa0732159a1415dd6cd4/pytest_asyncio-1.1.1.tar.gz", hash = "sha256:b72d215c38e2c91dbb32f275e0b5be69602d7869910e109360e375129960a649", size = 46590, upload-time = "2025-09-12T06:36:20.834Z" } | ||
| sdist = { url = "https://files.pythonhosted.org/packages/1d/27/f036ec4bcbfd056c54572d7169ba3dbb54e7181f02f21caadd3aecb9cf5b/pytest-asyncio-0.23.3.tar.gz", hash = "sha256:af313ce900a62fbe2b1aed18e37ad757f1ef9940c6b6a88e2954de38d6b1fb9f", size = 44841, upload-time = "2024-01-01T14:03:58.77Z" } | ||
| wheels = [ | ||
| { url = "https://files.pythonhosted.org/packages/28/de/aba79e9ccdb51b5d0d65c67dd857bd78b00c64723df16b9fc800d8b94ce6/pytest_asyncio-1.1.1-py3-none-any.whl", hash = "sha256:726339d30fcfde24691f589445b9b67d058b311ac632b1d704e97f20f1d878da", size = 14719, upload-time = "2025-09-12T06:36:19.726Z" }, | ||
| { url = "https://files.pythonhosted.org/packages/1d/d6/568f370599c794cc97e2f36293e06ee9bd5bd3a2d2eb62525671425d266b/pytest_asyncio-0.23.3-py3-none-any.whl", hash = "sha256:37a9d912e8338ee7b4a3e917381d1c95bfc8682048cb0fbc35baba316ec1faba", size = 17383, upload-time = "2024-01-01T14:03:56.293Z" }, | ||
| ] | ||
|
|
There was a problem hiding this comment.
🔴 Upgrading pytest to 9.0.2 caused pytest-asyncio to be downgraded from 1.1.1 to 0.23.3 (released 2024-01-01), because all pytest-asyncio 1.x versions declare pytest<9 as an upper bound. The current pyproject.toml constraint (>=0.21.1,<1.2.0) needs to be updated to allow pytest-asyncio ≥1.3.0, which is the first release to explicitly support pytest 9.x (pytest<10,>=8.2); without this fix the project's 48 async tests across 8 files may fail or behave incorrectly.
Extended reasoning...
What the bug is
When pytest was bumped from 8.4.2 to 9.0.2, the uv resolver also downgraded pytest-asyncio from 1.1.1 to 0.23.3. This is not an isolated coincidence — pytest-asyncio versions 0.24+ through 1.1.1 all declare a pytest<9,>=8.2 upper-bound constraint, making them incompatible with pytest 9.x. The first pytest-asyncio release that explicitly supports pytest 9.x is 1.3.0 (pytest<10,>=8.2). The resolver's only valid choice within the current >=0.21.1,<1.2.0 constraint was to fall back to 0.23.3 — a version released on 2024-01-01, almost two years before pytest 9.0.
The specific constraint that causes the regression
In pyproject.toml:
"pytest-asyncio>=0.21.1,<1.2.0"This range excludes 1.3.0+, so within it the only pytest-9-compatible version is 0.23.3 (which predates pytest 9 entirely and therefore never added the <9 guard). All versions between 0.24 and 1.1.1 are explicitly blocked.
Why existing safeguards don't catch this
The metadata-level dependency is technically satisfied (0.23.3 says pytest>=7.0.0 with no upper bound), so the resolver succeeds without error. There is no CI gate that checks whether the resolved version of a transitive dependency regressed. The pyproject.toml constraint was written before pytest 9.x existed, so it never anticipated this gap.
Impact
The project has 48 uses of @pytest.mark.asyncio across 8 test files:
test_decorators.py(10 marks)test_propagate_attributes.py(10 marks)test_langchain_integration.py(10 marks)test_utils.py(7 marks)test_openai.py(5 marks)test_batch_evaluation.py(3 marks)test_otel.py(2 marks)test_core_sdk.py(1 mark)
pytest-asyncio underwent major internal changes between 0.23.3 and 1.x (including changes to default asyncio_mode, event-loop scoping, and fixture handling). There is also no asyncio_mode set in [tool.pytest.ini_options], which in older versions triggers a deprecation warning or affects behavior differently than in newer versions. Running pytest 9.0.2 + pytest-asyncio 0.23.3 is an untested combination likely to produce subtle failures or incorrect results.
How to fix
Update pyproject.toml to allow pytest-asyncio 1.3.0+, the first version that explicitly declares pytest<10,>=8.2:
"pytest-asyncio>=1.3.0,<2"After updating the constraint, run uv lock to resolve to a compatible version and run the async test suite (pytest tests/ -m asyncio or similar) to confirm everything passes.
Step-by-step proof
pyproject.tomlhaspytest>=7.4,<10.0(updated by this PR) — selects pytest 9.0.2 ✓pyproject.tomlhaspytest-asyncio>=0.21.1,<1.2.0(unchanged) — candidate versions: 0.21.x, 0.22.x, 0.23.x, 1.0.x, 1.1.x- Versions 1.0.x and 1.1.x declare
pytest<9→ incompatible with 9.0.2, eliminated - Versions 0.24.x–0.26.x declare
pytest<9as well → eliminated - Only 0.21.x–0.23.x remain; resolver picks the highest: 0.23.3
- 0.23.3 was released 2024-01-01, over a year before pytest 9.0 (2025-11-12) — it was never tested against pytest 9 internals
- The resulting lock file contains pytest 9.0.2 + pytest-asyncio 0.23.3, an untested pairing for a codebase with 48 async tests
|
|
||
| [dependency-groups] | ||
| dev = [ | ||
| "pytest>=7.4,<9.0", | ||
| "pytest>=7.4,<10.0", | ||
| "pytest-timeout>=2.1.0,<3", | ||
| "pytest-xdist>=3.3.1,<4", | ||
| "pre-commit>=3.2.2,<4", |
There was a problem hiding this comment.
🟡 The pytest-asyncio downgrade from 1.1.1 to 0.23.3 (a side effect of the pytest 9.0.2 bump) introduces DeprecationWarnings on every test run because asyncio_mode is not set in [tool.pytest.ini_options]. Tests will still pass since all 48 async tests already use @pytest.mark.asyncio decorators (compatible with strict mode), but the warning noise can be suppressed by adding asyncio_mode = "strict" to the [tool.pytest.ini_options] section in pyproject.toml.
Extended reasoning...
What the bug is and how it manifests
When pytest-asyncio 0.23.x runs without an explicit asyncio_mode setting, it emits a DeprecationWarning on every test session: "The configuration option asyncio_mode is unset, the default value strict will be used". This PR bumps pytest from 8.4.2 to 9.0.2, which as a side effect resolves the pytest-asyncio constraint differently — downgrading it from 1.1.1 to 0.23.3. The 0.23.x series requires the explicit asyncio_mode option to avoid deprecation warnings, whereas 1.1.1 handled the missing configuration silently.
The specific code path that triggers it
The [tool.pytest.ini_options] section in pyproject.toml (lines 20–26) contains only log_cli = true with no asyncio_mode setting. pytest-asyncio 0.23.3 checks for this option at startup, and when absent, defaults to strict mode while emitting the deprecation warning.
Why existing code doesn't prevent it
The project previously depended on pytest-asyncio>=0.21.1,<1.2.0, and the lock file resolved to 1.1.1. In that version, the missing asyncio_mode either defaulted silently or was handled differently — no deprecation warning was triggered. The PR's pytest upper bound change (from <9.0 to <10.0) causes uv to resolve a different compatible set of transitive dependencies, landing on pytest-asyncio 0.23.3 instead of 1.1.1.
What the impact would be
Tests will not fail — all 48 async tests use explicit @pytest.mark.asyncio decorators, which is exactly what strict mode requires. The only impact is noisy DeprecationWarning output on every pytest invocation, which pollutes CI logs and can mask real warnings.
How to fix it
Add asyncio_mode = "strict" to [tool.pytest.ini_options] in pyproject.toml:
[tool.pytest.ini_options]
log_cli = true
asyncio_mode = "strict"Alternatively, resolving the pytest-asyncio version back to 1.1.1 (by explicitly pinning it) would also eliminate the warning, since 1.1.1 does not require explicit asyncio_mode configuration.
Step-by-step proof
- Before this PR:
uv.lockresolvespytest-asyncioto version 1.1.1, which does not emit the deprecation warning for a missingasyncio_mode. - After this PR:
uv.lockresolvespytest-asyncioto version 0.23.3 (visible in the diff — the package entry changes from1.1.1to0.23.3). - pytest-asyncio 0.23.3 checks for
asyncio_modeat startup. Since[tool.pytest.ini_options]only haslog_cli = true, the check fails to findasyncio_mode. - pytest-asyncio 0.23.3 emits:
DeprecationWarning: The configuration option asyncio_mode is unset, the default value strict will be used. - All 48 async tests still pass (strict mode is compatible with explicit
@pytest.mark.asynciodecorators), but the warning appears for every test session.
Bumps pytest from 8.4.2 to 9.0.2.
Release notes
Sourced from pytest's releases.
... (truncated)
Commits
3d10b51Prepare release version 9.0.2188750bMerge pull request #14030 from pytest-dev/patchback/backports/9.0.x/1e4b01d1f...b7d7befMerge pull request #14014 from bluetech/compat-notebd08e85Merge pull request #14013 from pytest-dev/patchback/backports/9.0.x/922b60377...bc78386Add CLI options reference documentation (#13930)5a4e398Fix docs typo (#14005) (#14008)d7ae6dfMerge pull request #14006 from pytest-dev/maintenance/update-plugin-list-tmpl...556f6a2pre-commit: fix rst-lint after new release (#13999) (#14001)c60fbe6Fix quadratic-time behavior when handlingunittestsubtests in Python 3.10 ...73d9b01Merge pull request #13995 from nicoddemus/patchback/backports/9.0.x/1b5200c0f...You can trigger a rebase of this PR by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)Disclaimer: Experimental PR review
Greptile Summary
This PR bumps
pytestfrom 8.4.2 to 9.0.2 (a major version bump) by relaxing the upper bound inpyproject.tomlfrom<9.0to<10.0. While the pytest upgrade itself is straightforward, the lock file reveals an unintended side-effect:pytest-asynciois silently downgraded from 1.1.1 to 0.23.3 becausepytest-asyncio1.x appears incompatible with pytest 9.x, causing uv's resolver to fall back to the highest compatible 0.x release.Key changes:
pyproject.toml:pytestconstraint widened from>=7.4,<9.0→>=7.4,<10.0uv.lock:pytest8.4.2 → 9.0.2uv.lock:pytest-asyncio1.1.1 → 0.23.3 (unintended regression — ~20 months of releases dropped)uv.lock:backports-asyncio-runner1.2.0 removed (was a transitive dependency ofpytest-asyncio1.1.1 for Python < 3.11)The project has no
asyncio_modesetting in[tool.pytest.ini_options], which will produceFutureWarningdeprecation noise withpytest-asyncio0.23.x. More importantly, thepytest-asyncioconstraint inpyproject.tomlshould be explicitly updated to reflect which version range is actually compatible with pytest 9, rather than letting the resolver silently pick an older version.Confidence Score: 4/5
Mostly safe to merge, but the silent pytest-asyncio downgrade from 1.1.1 to 0.23.3 should be reviewed and made intentional before landing.
A P1 issue exists: pytest-asyncio is silently downgraded ~20 months due to a resolver conflict with pytest 9.x. This is a dev-only dependency so it won't affect production, but it could silently break async test behaviour or introduce deprecation noise without the team being aware of the root cause. Confirming CI passes and explicitly acknowledging/pinning the pytest-asyncio version would resolve the concern.
uv.lock — specifically the pytest-asyncio version resolution and its interaction with the pytest 9.x constraint.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A["pyproject.toml\npytest >=7.4,<10.0\npytest-asyncio >=0.21.1,<1.2.0"] --> B["uv resolver"] B --> C["pytest 9.0.2 ✅"] B --> D{"pytest-asyncio 1.1.1\ncompatible with pytest 9.x?"} D -- "No (requires pytest <9)" --> E["pytest-asyncio 0.23.3 ⚠️\n(latest compatible 0.x)"] D -- "Would be preferred" --> F["pytest-asyncio 1.1.1\n(skipped)"] E --> G["backports-asyncio-runner\nremoved (was 1.1.1 dep)"] E --> H["No asyncio_mode set\n→ FutureWarning in CI"]Reviews (1): Last reviewed commit: "chore(deps-dev): bump pytest from 8.4.2 ..." | Re-trigger Greptile