From 64a6afc92e7fe14f79460925c3ec0e925078aca3 Mon Sep 17 00:00:00 2001 From: Cameron Hurst Date: Tue, 5 Jan 2021 08:10:50 -0500 Subject: [PATCH] fix: added async call to test client --- graphene/test/__init__.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/graphene/test/__init__.py b/graphene/test/__init__.py index f84c7e48..f60211bc 100644 --- a/graphene/test/__init__.py +++ b/graphene/test/__init__.py @@ -1,6 +1,5 @@ from graphql.error import format_error as format_graphql_error from graphql.error import GraphQLError -from graphql.pyutils import is_awaitable from graphene.types.schema import Schema @@ -32,14 +31,10 @@ class Client: def execute(self, *args, **kwargs): executed = self.schema.execute(*args, **dict(self.execute_options, **kwargs)) - if is_awaitable(executed): - executed = asyncio.run(executed) return self.format_result(executed) async def execute_async(self, *args, **kwargs): - executed = self.schema.execute(*args, **dict(self.execute_options, **kwargs)) - if is_awaitable(executed): - executed = await executed + executed = await self.schema.execute_async(*args, **dict(self.execute_options, **kwargs)) return self.format_result(executed)