IsolatedAsyncioTestCase `__del__` could be dangerous
It looks like in IsolatedAsyncioTestCase when debug() crashes it doesn't teardown the event loop, in addition it seems that if the loop isn't torn down it will happen in __del__ which means thread local sensitive functions like set_event_loop get called via the GC from potentially the wrong thread
Originally posted by @graingert in https://github.com/python/cpython/pull/95898#discussion_r946516908
Apart from a reproducer it would be nice if your issue description was more clearly stating the problem. Quoting from the middle of another discussion is just confusing.
I had a go at undrafting the issue, I still need to make a reproducer
Hm... I had sort of assumed that debug() was intentionally not cleaning anything up on failure -- TestCase.debug() doesn't either (it has a special case for @skip though).
PS. There is no such thing as a draft issue.
What's the status of this? @graingert Do you have a reproducer?
Nothing changed. #96135 solved some potential problems in our tests of unittest by using a private method, but the original problem still exists.
It is not even clear what solution should be.