Skip to content

Commit 766b4f1

Browse files
committed
Use correct terminology around iterators and iterable
Replicates graphql/graphql-js@947ca28
1 parent 2e0ebd8 commit 766b4f1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tests/subscription/test_map_async_iterator.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ async def source():
2828
assert await anext(doubles)
2929

3030
@mark.asyncio
31-
async def maps_over_async_iterator():
31+
async def maps_over_async_iterable():
3232
items = [1, 2, 3]
3333

34-
class Iterator:
34+
class Iterable:
3535
def __aiter__(self):
3636
return self
3737

@@ -41,7 +41,7 @@ async def __anext__(self):
4141
except IndexError:
4242
raise StopAsyncIteration
4343

44-
doubles = MapAsyncIterator(Iterator(), lambda x: x + x)
44+
doubles = MapAsyncIterator(Iterable(), lambda x: x + x)
4545

4646
values = [value async for value in doubles]
4747

@@ -99,10 +99,10 @@ async def source():
9999
await anext(doubles)
100100

101101
@mark.asyncio
102-
async def allows_returning_early_from_mapped_async_iterator():
102+
async def allows_returning_early_from_mapped_async_iterable():
103103
items = [1, 2, 3]
104104

105-
class Iterator:
105+
class Iterable:
106106
def __aiter__(self):
107107
return self
108108

@@ -112,7 +112,7 @@ async def __anext__(self):
112112
except IndexError: # pragma: no cover
113113
raise StopAsyncIteration
114114

115-
doubles = MapAsyncIterator(Iterator(), lambda x: x + x)
115+
doubles = MapAsyncIterator(Iterable(), lambda x: x + x)
116116

117117
assert await anext(doubles) == 2
118118
assert await anext(doubles) == 4
@@ -151,10 +151,10 @@ async def source():
151151
assert await anext(doubles)
152152

153153
@mark.asyncio
154-
async def allows_throwing_errors_through_async_iterators():
154+
async def allows_throwing_errors_through_async_iterable():
155155
items = [1, 2, 3]
156156

157-
class Iterator:
157+
class Iterable:
158158
def __aiter__(self):
159159
return self
160160

@@ -164,7 +164,7 @@ async def __anext__(self):
164164
except IndexError: # pragma: no cover
165165
raise StopAsyncIteration
166166

167-
doubles = MapAsyncIterator(Iterator(), lambda x: x + x)
167+
doubles = MapAsyncIterator(Iterable(), lambda x: x + x)
168168

169169
assert await anext(doubles) == 2
170170
assert await anext(doubles) == 4

0 commit comments

Comments
 (0)