cpython
cpython copied to clipboard
gh-96030: IsolatedAsyncioTestCase: don't create asyncio runner for skipped tests
- Issue: gh-96030
This is an interesting approach, and I would prefer a code that overrides methods like _callSetUp() over the code that overrides run(), but there are problems with current code. I think that simpler #96033 should fix the original issue.
My approach addresses the fact that the current code does too much when a test is skipped.
Let's merge your simple fix to unblock main and somebody else can take over my PR fix the code properly.
How does this compare to #96033? It seems that is meant to fix the same issue.
This PR appears doomed. @tiran want to just close it?
The original issue was fixed, and it is a proper solution.
The code can be made more "elegant" if use the abstarct idea of this PR. I tried to implement it, but the simple and clear implementation of it free from the flaws of this PR suffered from two other issues:
- It breaks the case when
doCleanup()is called intesrDown(). This case is not covered by IsolatedAsyncioTestCase, but it happens with non-asynchronous tests, and it can happen with third party asynchronous tests, - It creates a reference loop, which make the problem of cleaning up of abandoned IsolatedAsyncioTestCase instance worse.
It is possible to fix these two issues also, but the resulting code is far from "elegant". So for now I'm happy with the current code.
So for now I'm happy with the current code.
So this issue is good to close?
Closing per Serhiy's recommendation.