Skip to content

ci(pytest): set asyncio_default_fixture_loop_scope so pytest-asyncio 1.4.1 does not abort the suite - #150

Merged
GreenGrassBlueOcean merged 1 commit into
OpenWebNet-HA:masterfrom
gdluck:fix/pytest-asyncio-fixture-loop-scope
Oct 28, 2026
Merged

GreenGrassBlueOcean merged 1 commit into
OpenWebNet-HA:masterfrom
gdluck:fix/pytest-asyncio-fixture-loop-scope

Conversation

@gdluck

@gdluck gdluck commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Requested by A

Before: since the pytest-asyncio 1.4.1 release, every Tests & Coverage job on every open OWNd PR aborts with exit code 3 before collecting a single test: INTERNALERROR> pytest.PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset. The plugin now emits that warning in pytest_configure, and pyproject.toml turns DeprecationWarning into an error. master's last green run (12fef0c, 2026-10-27 18:23) predates the release; its next run would fail the same way.

After: [tool.pytest.ini_options] sets asyncio_default_fixture_loop_scope = "function", the scope the suite has always used (every async fixture is function-scoped), so nothing changes at runtime and the suite runs again.

Evidence

Once this lands, the open PRs turn green on their next rebase (#137, #138, #142 are the ones currently red on this; #139's MyHOME-suite job is red by design, pending_decoder_rx).

🤖 Generated with Claude Code

…1.4.1 does not abort the suite

pytest-asyncio 1.4.1 emits PytestDeprecationWarning at configure time when
asyncio_default_fixture_loop_scope is unset; with filterwarnings =
error::DeprecationWarning that warning becomes an INTERNALERROR before any
test is collected (exit code 3 in the Tests & Coverage jobs of every open PR
since the release). The suite's async fixtures are all function-scoped, so
the option is set to "function", which changes nothing at runtime.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@GreenGrassBlueOcean GreenGrassBlueOcean left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Clean, minimal, and exact root-cause fix — thank you for jumping on this right away.

  • Root cause verified: pytest-asyncio >= 1.4.1 emits PytestDeprecationWarning inside pytest_configure when asyncio_default_fixture_loop_scope is unset, which filterwarnings = ["error::DeprecationWarning", ...] turns into an INTERNALERROR (exit code 3) before test collection across Python 3.11–3.14.
  • Fix verified: Every async fixture in the OWNd suite is function-scoped, so setting asyncio_default_fixture_loop_scope = "function" in [tool.pytest.ini_options] preserves exact runtime semantics without loosening DeprecationWarning enforcement.
  • Checks: All 8 CI checks (Tests & Coverage 3.11–3.14, Static analysis, Build package, Golden corpus & smoke gates, and MyHOME test suite) are green, single clean commit (00573dc3) directly on master.

LGTM — merging so #138, #142, #137, and #139 can rebase cleanly onto green master.

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.

3 participants