11from functools import reduce
2- from inspect import isawaitable
32
43from pytest import mark
54
6- from graphql .pyutils import async_reduce
5+ from graphql .pyutils import async_reduce , is_awaitable
76
87
98def describe_async_reduce ():
@@ -25,7 +24,7 @@ def callback(accumulator, current_value):
2524
2625 values = ["bar" , "baz" ]
2726 result = async_reduce (callback , values , "foo" )
28- assert not isawaitable (result )
27+ assert not is_awaitable (result )
2928 assert result == "foo-bar-baz"
3029
3130 @mark .asyncio
@@ -38,7 +37,7 @@ def callback(accumulator, current_value):
3837
3938 values = ["bar" , "baz" ]
4039 result = async_reduce (callback , values , async_initial_value ())
41- assert isawaitable (result )
40+ assert is_awaitable (result )
4241 assert await result == "foo-bar-baz"
4342
4443 @mark .asyncio
@@ -48,7 +47,7 @@ async def async_callback(accumulator, current_value):
4847
4948 values = ["bar" , "baz" ]
5049 result = async_reduce (async_callback , values , "foo" )
51- assert isawaitable (result )
50+ assert is_awaitable (result )
5251 assert await result == "foo-bar-baz"
5352
5453 @mark .asyncio
@@ -60,5 +59,5 @@ async def async_callback(accumulator, current_value):
6059 return accumulator * current_value
6160
6261 result = async_reduce (async_callback , range (6 , 9 ), async_initial_value ())
63- assert isawaitable (result )
62+ assert is_awaitable (result )
6463 assert await result == 42
0 commit comments