Skip to content

Bump pytest-asyncio to 1.3.0#695

Draft
TheJulianJES wants to merge 3 commits into
zigpy:devfrom
TheJulianJES:tjj/pytest_asyncio_1.3.0
Draft

Bump pytest-asyncio to 1.3.0#695
TheJulianJES wants to merge 3 commits into
zigpy:devfrom
TheJulianJES:tjj/pytest_asyncio_1.3.0

Conversation

@TheJulianJES
Copy link
Copy Markdown
Contributor

This bumps the minimum required pytest-asyncio version 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_loop fixture was finally dropped (long deprecated before).

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.51%. Comparing base (9d03d63) to head (1f25f3d).
⚠️ Report is 35 commits behind head on dev.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Collaborator

@zigpy-review-bot zigpy-review-bot left a comment

Choose a reason for hiding this comment

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

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 upstream pytest_asyncio.plugin deprecation warnings for asyncio.get_event_loop_policy / set_event_loop_policy on 3.14 — those disappear on this PR.
  • looptime still works correctly under pytest-asyncio 1.3.0; test_async_.py (the only file excluded from the looptime marker in pytest_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.

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.

2 participants