Skip to content

Remove un-necessary socket requirements in async tests #128404

Open

Description

@graingert

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

Activity

  1. added
    type-featureA feature request or enhancement
    testsTests in the Lib/test dir
    and removed
    type-featureA feature request or enhancement
    on Jan 2, 2025
  2. added a commit that references this issue on Jan 2, 2025
  3. Eclips4 commented on Jan 2, 2025

    @Eclips4
    Member

    @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.

  4. graingert commented on Jan 2, 2025

    @graingert
    ContributorAuthor

    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.

  5. Eclips4 commented on Jan 2, 2025

    @Eclips4
    Member

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

  6. changed the title [-] Remove un-necessary socket requirements in builtins async tests[/-] [+] Remove un-necessary socket requirements in async tests[/+] on Jan 2, 2025
  7. added 2 commits that reference this issue on Jan 3, 2025
  8. added a commit that references this issue on Jan 3, 2025
  9. added a commit that references this issue on Jan 3, 2025
  10. added a commit that references this issue on Jan 3, 2025
  11. graingert commented on Jan 4, 2025

    @graingert
    ContributorAuthor

    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

  12. added a commit that references this issue on Jan 4, 2025
  13. added 3 commits that reference this issue on Jan 8, 2025
  14. added 2 commits that reference this issue on Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dir

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions