summaryrefslogtreecommitdiff
path: root/tests/extmod/asyncio_new_event_loop.py
AgeCommit message (Collapse)Author
2024-11-28tests/extmod: Workaround CPython warning in asyncio_new_event_loop test.Angus Gratton
This started failing in CI on the mingw build, after CPython updated to 3.12.7. The test prints two warnings during interpreter shutdown of "Task was destroyed but it is pending!". This didn't happen on other CPython builds, and I think that's because of finalizer order in CPython interpreter shutdown but not certain (the loop finalizer calls loop.close() if not already closed). Adding explicit calls to loop.close() causes the warning to be printed on every run with CPython 3.12.7 on Linux. Next, added the workaround exception handler to swallow this exception as MicroPython doesn't produce an equivalent. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-07-18tests/extmod: Make get_event_loop tests compatible with CPython 3.12.Damien George
Follow up to 2e852522b178e6e9b2f0cdb954ba44aa9e7d7c0d: instead of having .exp files for the get_event_loop tests, tweak them so they are compatible with CPython 3.12. This requires calling `asyncio.set_event_loop()` so there is an active event loop and `asyncio.get_event_loop()` succeeds without a warning. Signed-off-by: Damien George <damien@micropython.org>
2024-05-27tests/extmod: Add .exp test files for asyncio.get_event_loop tests.Damien George
And use `asyncio.new_event_loop()` where possible. This change is needed because CPython 3.12 deprecated the `get_event_loop()` function. Signed-off-by: Damien George <damien@micropython.org>
2023-06-19tests: Rename uasyncio to asyncio.Jim Mussared
This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>