pytest-dev/pytest-asyncio

Cannot handle event loop set up and tear down in 1.0

Opened this issue · 2 comments

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

Thanks for bringing this to attention!

#205 proposes to have a default loop exception handler that re-raises exceptions in background tasks.
@schlamar would this be sufficient for your use case or do you specifically need to set a custom exception handler?