Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies = [

[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",
Comment on lines 20 to 26
Copy link
Copy Markdown

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_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

  1. Before this PR: uv.lock resolves pytest-asyncio to version 1.1.1, which does not emit the deprecation warning for a missing asyncio_mode.
  2. After this PR: uv.lock resolves pytest-asyncio to version 0.23.3 (visible in the diff — the package entry changes from 1.1.1 to 0.23.3).
  3. pytest-asyncio 0.23.3 checks for asyncio_mode at startup. Since [tool.pytest.ini_options] only has log_cli = true, the check fails to find asyncio_mode.
  4. pytest-asyncio 0.23.3 emits: DeprecationWarning: The configuration option asyncio_mode is unset, the default value strict will be used.
  5. All 48 async tests still pass (strict mode is compatible with explicit @pytest.mark.asyncio decorators), but the warning appears for every test session.

Expand Down
24 changes: 7 additions & 17 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading