gh-128404: Run TestGetAsyncGenState without asyncio - #156808
Open
graingert wants to merge 2 commits into
Open
Conversation
inspect.getasyncgenstate() and getasyncgenlocals() are pure introspection: none of the awaits in these tests suspend, so the class does not need an event loop and does not need to be skipped when there is no working socket. Drive the coroutines with support.run_no_yield_async_fn() instead, as the neighbouring TestGetCoroutineState already does, using the same _async_test decorator as test_contextlib_async. This also drops the last use of asyncio in the module.
test_easy_debugging and the three getasyncgenlocals tests never touch the async generator built by setUp; they built their own or used none at all. Move them to TestGetAsyncGenLocals, which needs no fixture.
Member
|
Maybe we should move this helper to somewhere in |
Member
|
Oh, right. I rewrote the decorator as |
Contributor
Author
|
it needs functools.wraps to copy in flags such as edit: I suppose you can put the skipIf/skip decorator on top of the
|
Contributor
Author
|
my |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
inspect.getasyncgenstate() and getasyncgenlocals() are pure introspection: none of the awaits in these tests suspend, so the class does not need an event loop and does not need to be skipped when there is no working socket.
Drive the coroutines with support.run_no_yield_async_fn() instead, as the neighbouring TestGetCoroutineState already does, using the same _async_test decorator as test_contextlib_async. This also drops the last use of asyncio in the module.