diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62ce981..897d77a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11.0-rc.1 - 3.11"] os: [macOS-latest, ubuntu-latest, windows-latest] steps: diff --git a/aioitertools/asyncio.py b/aioitertools/asyncio.py index 65ff2ad..8cdef51 100644 --- a/aioitertools/asyncio.py +++ b/aioitertools/asyncio.py @@ -51,7 +51,7 @@ async def as_completed( """ done: Set[Awaitable[T]] = set() - pending: Set[Awaitable[T]] = set(aws) + pending: Set[Awaitable[T]] = {asyncio.ensure_future(a) for a in aws} remaining: Optional[float] = None if timeout and timeout > 0: diff --git a/aioitertools/tests/helpers.py b/aioitertools/tests/helpers.py index 519329d..f222177 100644 --- a/aioitertools/tests/helpers.py +++ b/aioitertools/tests/helpers.py @@ -3,7 +3,8 @@ import asyncio import functools -from unittest import TestCase +import sys +from unittest import skipIf, TestCase from aioitertools.helpers import deprecated_wait_param, maybe_await @@ -37,6 +38,7 @@ class HelpersTest(TestCase): self.assertEqual(await maybe_await(forty_two()), 42) + @skipIf(sys.version_info >= (3, 11), "@asyncio.coroutine removed") @async_test async def test_maybe_await_coroutine(self): @asyncio.coroutine diff --git a/requirements-dev.txt b/requirements-dev.txt index 9e0eaa3..e549f0b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,7 @@ attribution==1.5.2 black==22.8.0 -coverage[toml]==6.2 +coverage[toml]==6.2; python_version < "3.10" +coverage==6.4.4; python_version >= "3.10" flake8==5.0.4 flit==3.7.1 mypy==0.971