achimnol / aiotools

Idiomatic asyncio utilties
https://aiotools.readthedocs.io
MIT License
153 stars 11 forks source link

Fix regression in timer test cases with latest pytest-asyncio #1

Closed achimnol closed 7 years ago

achimnol commented 7 years ago

https://github.com/pytest-dev/pytest-asyncio/issues/54

The timer test cases using pytest-asyncio 0.6.0 began to fail since 7ec75cf (the travis job log). It works fine with pytest-asyncio 0.5.0, but we need to check what's happening there.

There seems to be some side-effects of using the default event loop via asyncio.get_event_loop() and recreating it if once closed, as I didn't touch anything in timer-related codes. The interesting part is that timer tests are failing alternatingly instead of all.

achimnol commented 7 years ago

This is now fixed by creating/destroying new event loops dedicated for start_server() function.