Skip to content

Commit 2ed67bc

Browse files
author
Cameron Hurst
committed
fix: added async call to test client
1 parent e052d18 commit 2ed67bc

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

graphene/test/__init__.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from graphql.error import format_error as format_graphql_error
22
from graphql.error import GraphQLError
3-
from graphql.pyutils import is_awaitable
43

54
from graphene.types.schema import Schema
65

@@ -32,14 +31,10 @@ def format_result(self, result):
3231

3332
def execute(self, *args, **kwargs):
3433
executed = self.schema.execute(*args, **dict(self.execute_options, **kwargs))
35-
if is_awaitable(executed):
36-
executed = asyncio.run(executed)
3734

3835
return self.format_result(executed)
3936

4037
async def execute_async(self, *args, **kwargs):
41-
executed = self.schema.execute(*args, **dict(self.execute_options, **kwargs))
42-
if is_awaitable(executed):
43-
executed = await executed
38+
executed = await self.schema.execute_async(*args, **dict(self.execute_options, **kwargs))
4439

4540
return self.format_result(executed)

0 commit comments

Comments
 (0)