Cannot handle event loop set up and tear down in 1.0
Opened this issue · 2 comments
schlamar commented
Before 1.0 you could use the "event_loop" fixture for custom set up and tear down instructions on the event loop.
With removal of the fixture in 1.0.0 there seems to be no way to access the event_loop before it is running and after it has stopped.
Example use cases:
- define exception handler to fail test if exception occurs
- clean up pending tasks after test has run
seifertm commented
schlamar commented
For set up, yes. At least in the moment.
However this does not cover the tear down use case. Clean up stuff after loop is stopped.
20.06.2025 09:51:14 Michael Seifert ***@***.***>:
…
[Bild]*seifertm* left a comment (pytest-dev/pytest-asyncio#1133)[#1133 (comment)]
Thanks for bringing this to attention!
#205[#205] proposes to have a default loop exception handler that re-raises exceptions in background tasks.
@schlamar[https://github.com/schlamar] would this be sufficient for your use case or do you specifically need to set a custom exception handler?
—
Reply to this email directly, view it on GitHub[#1133 (comment)], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AAB2IPAHRRUPG2ZHTDZXTQL3EO4OHAVCNFSM6AAAAAB6MZWBOKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSOJQGE3DGNJTHA].
You are receiving this because you were mentioned.
[Verfolgungsbild][https://github.com/notifications/beacon/AAB2IPFCRBGT6MTBIZG27F33EO4OHA5CNFSM6AAAAAB6MZWBOKWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTVSHJDFE.gif]