beeware / toga

A Python native, OS native GUI toolkit.
https://toga.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
4.19k stars 655 forks source link

Use latest dependencies for Testbed testing #2652

Closed rmartin16 closed 2 weeks ago

rmartin16 commented 2 weeks ago

Changes

PR Checklist:

rmartin16 commented 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.

freakboy3742 commented 2 weeks ago

My asyncio skills are what they are....so definitely open to better approaches.

... My good sir, you are massively underselling your skill set here :-)