Skip to content

Commit 83e06f8

Browse files
Support Py3.12 (#113)
* test py3.12 and selected pypy up to 3.10 * skip concurrency test on PyPy * extend package markers up to Py3.12
1 parent f89c487 commit 83e06f8

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

.github/workflows/unittests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ jobs:
1111
runs-on: ubuntu-20.04
1212
strategy:
1313
matrix:
14-
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-3.6', 'pypy-3.7']
14+
python-version: [
15+
'3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12',
16+
'pypy-3.6', 'pypy-3.8', 'pypy-3.10'
17+
]
1518

1619
steps:
1720
- uses: actions/checkout@v3

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ classifiers = [
2020
"Programming Language :: Python :: 3.8",
2121
"Programming Language :: Python :: 3.9",
2222
"Programming Language :: Python :: 3.10",
23+
"Programming Language :: Python :: 3.11",
24+
"Programming Language :: Python :: 3.12",
2325
]
2426
license = {"file" = "LICENSE"}
2527
keywords = ["async", "enumerate", "itertools", "builtins", "functools", "contextlib"]

unittests/test_itertools.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import itertools
22
import sys
3+
import platform
34

45
import pytest
56

@@ -318,21 +319,27 @@ async def test_peer(peer_tee):
318319
sys.version_info < (3, 8),
319320
reason="async generators only protect against concurrent access since 3.8",
320321
)
322+
@pytest.mark.skipif(
323+
platform.python_implementation() != "CPython",
324+
reason="async generators only protect against concurrent access on CPython",
325+
)
321326
@multi_sync
322327
async def test_tee_concurrent_unlocked():
323-
"""Test that does not prevent concurrency without a lock"""
328+
"""Test that tee does not prevent concurrency without a lock"""
324329
items = list(range(12))
325330

331+
# concurrency-unsafe iterator that task-switches between yields
326332
async def iter_values():
327333
for item in items:
328-
# switch to other tasks a few times to guarantees another runs
334+
# switch to other tasks a few times to guarantee another runs
329335
for _ in range(5):
330336
await Switch()
331337
yield item
332338

333339
async def test_peer(peer_tee):
334340
assert await a.list(peer_tee) == items
335341

342+
# schedule two tasks that read via tee from the same iterator
336343
this, peer = a.tee(iter_values(), n=2)
337344
await Schedule(test_peer(peer))
338345
await Switch()

0 commit comments

Comments
 (0)