Skip to content

Commit 1577571

Browse files
committed
Fix async tests in test_query
1 parent d386a7e commit 1577571

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

graphene_django/tests/test_query.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,8 @@ class Query(graphene.ObjectType):
709709
graphene_settings.RELAY_CONNECTION_ENFORCE_FIRST_OR_LAST = False
710710

711711

712-
def test_should_query_promise_connectionfields():
712+
@pytest.mark.asyncio
713+
async def test_should_query_promise_connectionfields():
713714
from promise import Promise
714715

715716
class ReporterType(DjangoObjectType):
@@ -738,7 +739,7 @@ def resolve_all_reporters(self, info, **args):
738739

739740
expected = {"allReporters": {"edges": [{"node": {"id": "UmVwb3J0ZXJUeXBlOjE="}}]}}
740741

741-
result = schema.execute(query)
742+
result = await schema.execute_async(query)
742743
assert not result.errors
743744
assert result.data == expected
744745

@@ -821,7 +822,8 @@ def resolve_all_reporters(self, info, **args):
821822
assert result.data == expected
822823

823824

824-
def test_should_query_dataloader_fields():
825+
@pytest.mark.asyncio
826+
async def test_should_query_dataloader_fields():
825827
from promise import Promise
826828
from promise.dataloader import DataLoader
827829

@@ -914,7 +916,7 @@ class Query(graphene.ObjectType):
914916
}
915917
}
916918

917-
result = schema.execute(query)
919+
result = await schema.execute_async(query)
918920
assert not result.errors
919921
assert result.data == expected
920922

0 commit comments

Comments
 (0)