-
Notifications
You must be signed in to change notification settings - Fork 255
chore(deps-dev): bump pytest from 8.4.2 to 9.0.2 #1592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dependabot
wants to merge
1
commit into
main
Choose a base branch
from
dependabot/uv/pytest-9.0.2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+8
−18
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 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_modeis not set in[tool.pytest.ini_options]. Tests will still pass since all 48 async tests already use@pytest.mark.asynciodecorators (compatible with strict mode), but the warning noise can be suppressed by addingasyncio_mode = "strict"to the[tool.pytest.ini_options]section inpyproject.toml.Extended reasoning...
What the bug is and how it manifests
When pytest-asyncio 0.23.x runs without an explicit
asyncio_modesetting, 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 thepytest-asyncioconstraint differently — downgrading it from 1.1.1 to 0.23.3. The 0.23.x series requires the explicitasyncio_modeoption 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 inpyproject.toml(lines 20–26) contains onlylog_cli = truewith noasyncio_modesetting. 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 missingasyncio_modeeither defaulted silently or was handled differently — no deprecation warning was triggered. The PR's pytest upper bound change (from<9.0to<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.asynciodecorators, which is exactly what strict mode requires. The only impact is noisy DeprecationWarning output on everypytestinvocation, which pollutes CI logs and can mask real warnings.How to fix it
Add
asyncio_mode = "strict"to[tool.pytest.ini_options]inpyproject.toml: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_modeconfiguration.Step-by-step proof
uv.lockresolvespytest-asyncioto version 1.1.1, which does not emit the deprecation warning for a missingasyncio_mode.uv.lockresolvespytest-asyncioto version 0.23.3 (visible in the diff — the package entry changes from1.1.1to0.23.3).asyncio_modeat startup. Since[tool.pytest.ini_options]only haslog_cli = true, the check fails to findasyncio_mode.DeprecationWarning: The configuration option asyncio_mode is unset, the default value strict will be used.@pytest.mark.asynciodecorators), but the warning appears for every test session.