Bump pytest-asyncio to 1.3.0#695
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #695 +/- ##
=======================================
Coverage 97.51% 97.51%
=======================================
Files 62 62
Lines 10949 10950 +1
=======================================
+ Hits 10677 10678 +1
Misses 272 272 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
zigpy-review-bot
left a comment
There was a problem hiding this comment.
Looks correct. The migration from the long-deprecated event_loop fixture to asyncio.get_running_loop() is the right shape, and the inspect.iscoroutinefunction swap is the recommended replacement for asyncio.iscoroutinefunction (deprecated in Python 3.12, slated for removal in 3.16).
Tested locally in a /tmp/pr-695 worktree against pytest-asyncio==1.3.0, looptime==0.7, Py 3.14.4:
- Full suite: 1300 passed, 71 warnings.
- For comparison,
dev(pytest-asyncio<1.0, Py 3.14) emits ~11,800 warnings in the same run, the bulk being upstreampytest_asyncio.plugindeprecation warnings forasyncio.get_event_loop_policy/set_event_loop_policyon 3.14 — those disappear on this PR. looptimestill works correctly under pytest-asyncio 1.3.0;test_async_.py(the only file excluded from thelooptimemarker inpytest_collection_modifyitems) passes too.- mypy delta: -- no regression vs dev.
Cross-PR with #696: the two PRs are complementary, not overlapping. #696 suppresses zigpy-side warnings (is_manufacturer_specific without manufacturer_code, and the Unique IDs are unique only with platform prefix UserWarning), which are unaffected by this PR. The ~11,700-warning drop here is entirely from pytest-asyncio's own internals being updated for newer Python. Both PRs together would give a near-clean warnings output. Worth landing #695 first since it resolves the noise at source.
No blockers. Existing settings (asyncio_mode = "auto", asyncio_default_fixture_loop_scope = "function" in pyproject.toml) remain correct under 1.3.0. The PR body's note that 1.0.0 would suffice is accurate — the breaking change (event_loop removal) landed in 1.0.0 — but pinning to 1.3.0 is fine.
Ready to come out of draft from a review standpoint.
This bumps the minimum required
pytest-asyncioversion to 1.3.0, though as low as 1.0.0 is probably fine as well.It's just a test dependency though, so pinned it to what I tested with.
Multiple changes were made to make it work, since the
event_loopfixture was finally dropped (long deprecated before).