Skip to content

Commit b303065

Browse files
committed
test_subscribe: general cleanup and simplify test setups
Replicates graphql/graphql-js@2673bdf
1 parent 706a2b0 commit b303065

File tree

2 files changed

+255
-332
lines changed

2 files changed

+255
-332
lines changed

tests/subscription/test_map_async_iterator.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@
66
from graphql.subscription.map_async_iterator import MapAsyncIterator
77

88

9-
async def anext(iterable):
10-
"""Return the next item from an async iterator."""
11-
return await iterable.__anext__()
9+
try: # pragma: nocover
10+
anext
11+
except NameError: # pragma: nocover (Python < 3.10)
12+
# noinspection PyShadowingBuiltins
13+
async def anext(iterator):
14+
"""Return the next item from an async iterator."""
15+
return await iterator.__anext__()
1216

1317

1418
def describe_map_async_iterator():

0 commit comments

Comments
 (0)