Skip to content

tests: use asyncio.run() so the suite runs on Python 3.12+ - #110

Merged
zakery292 merged 1 commit into
Monitor-My-Solar:developmentfrom
RAR:tests/asyncio-run
Aug 2, 2026
Merged

tests: use asyncio.run() so the suite runs on Python 3.12+#110
zakery292 merged 1 commit into
Monitor-My-Solar:developmentfrom
RAR:tests/asyncio-run

Conversation

@RAR

@RAR RAR commented Aug 2, 2026

Copy link
Copy Markdown

The test suite can't be collected on a current Python. asyncio.get_event_loop() no longer creates a loop implicitly — deprecated in 3.12, removed in 3.14 — so every test using the _run(...) helper fails with:

RuntimeError: There is no current event loop in thread 'MainThread'.

asyncio.run() is the documented replacement and is equivalent here: each helper call wraps a single independent coroutine, so there's no shared loop state to preserve across calls.

Mechanical change across 9 test files, no source changes.

Before (Python 3.14): collection interrupted, suite unrunnable.
After: 175 passed.

Split out from a separate bug-fix branch so it can be reviewed on its own — the fix work is unrelated and just needed a runnable suite.

…te()

asyncio.get_event_loop() no longer creates a loop implicitly (deprecated in
3.12, removed in 3.14), so every test using this helper raised
'RuntimeError: There is no current event loop in thread' and the suite could
not be collected on a current interpreter.

175 passed on Python 3.14 after this change.
@zakery292
zakery292 merged commit 7989720 into Monitor-My-Solar:development Aug 2, 2026
1 check failed
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