diff --git a/graphene/test/__init__.py b/graphene/test/__init__.py index 13b05dd3b..30e516c61 100644 --- a/graphene/test/__init__.py +++ b/graphene/test/__init__.py @@ -1,4 +1,4 @@ -from promise import Promise, is_thenable +from graphql.error import format_error as format_graphql_error from graphql.error import GraphQLError from graphene.types.schema import Schema @@ -31,7 +31,10 @@ def format_result(self, result): def execute(self, *args, **kwargs): executed = self.schema.execute(*args, **dict(self.execute_options, **kwargs)) - if is_thenable(executed): - return Promise.resolve(executed).then(self.format_result) + + return self.format_result(executed) + + async def execute_async(self, *args, **kwargs): + executed = await self.schema.execute_async(*args, **dict(self.execute_options, **kwargs)) return self.format_result(executed)