Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove un-necessary socket requirements in async tests #128404

Open
graingert opened this issue Jan 2, 2025 · 4 comments
Open

Remove un-necessary socket requirements in async tests #128404

graingert opened this issue Jan 2, 2025 · 4 comments
Labels
tests Tests in the Lib/test dir

Comments

@graingert
Copy link
Contributor

graingert commented Jan 2, 2025

Proposal:

the builtins async tests should run coroutines using coro.send(None) because they don't need an async framework to run. This would remove asyncio from the tests and support running on emscripten/wasi

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

@graingert graingert added type-feature A feature request or enhancement tests Tests in the Lib/test dir and removed type-feature A feature request or enhancement labels Jan 2, 2025
Eclips4 pushed a commit that referenced this issue Jan 2, 2025
@Eclips4
Copy link
Member

Eclips4 commented Jan 2, 2025

@graingert Are there many other tests that rely on the asyncio framework that in fact shouldn't rely on it?
If so, let's reuse this issue for them.

@graingert
Copy link
Contributor Author

I think there's only 3-4 files left.

The last ones I want to touch are test_coroutine.py and test_asyncgens.py because they need a bit of thought. I'd like them split into using framework free code to test the object, and tests that test how asyncio interact with the object moved into test_asyncio. This will involve some duplication I think.

@Eclips4
Copy link
Member

Eclips4 commented Jan 2, 2025

Let's now use this issue, and later create issues for test_coroutine & test_asyncgens.

@Eclips4 Eclips4 changed the title Remove un-necessary socket requirements in builtins async tests Remove un-necessary socket requirements in async tests Jan 2, 2025
graingert added a commit to graingert/cpython that referenced this issue Jan 3, 2025
graingert added a commit to graingert/cpython that referenced this issue Jan 3, 2025
graingert added a commit to graingert/cpython that referenced this issue Jan 3, 2025
@graingert
Copy link
Contributor Author

I've gone with this issue currently, for test_asyngens as it's currently a relatively minor rearrangement to start with. I'll do another issue for duplicating auditing the tests that still use asyncio.run/loop.run_until_complete and creating tests that work on wasi etc, while keeping the tests that verify the asyncio integration

WolframAlph pushed a commit to WolframAlph/cpython that referenced this issue Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir
Projects
None yet
Development

No branches or pull requests

2 participants