Closed rmartin16 closed 2 weeks ago
So, these changes in pytest-asyncio
have not been particularly well accepted by the community....but it seems the maintainer was between a rock and hard spot in trying to manage upstream deprecations in asyncio
itself...although, there's also evidence of potentially less-than-ideal design choices.
At any rate, once I was able to wrap my head around how any of this even works, there is where I landed. Fortunately, Toga's use of pytest-asyncio
here is relatively straightforward relative to other use-cases from which I was seeking inspiration.
A potentially notable aspect of this approach stems from the fact that pytest-asyncio
defaults to isolating all tests to their own event loop; there are several strategies for expanding the scope of an event loop. My strategy here, though, allows pytest-asyncio
to "create" a new event loop for each test....but, via this new policy, the same event loop is returned for each "new loop request".
My asyncio
skills are what they are....so definitely open to better approaches.
Finally, in trying to understand the linux failures in CI (i.e #2648), I figured it was a good idea to get on the latest versions of everything first.
My
asyncio
skills are what they are....so definitely open to better approaches.
... My good sir, you are massively underselling your skill set here :-)
Changes
event_loop()
fixture. However, an event loop policy can be specified via theevent_loop_policy()
fixture.PR Checklist: