From 15775712be01f7191431d0f6b9b560d76380ef4a Mon Sep 17 00:00:00 2001 From: Tomasz Kontusz Date: Sun, 15 Sep 2019 22:14:35 +0200 Subject: [PATCH] Fix async tests in test_query --- graphene_django/tests/test_query.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/graphene_django/tests/test_query.py b/graphene_django/tests/test_query.py index 043db7b..d072fc9 100644 --- a/graphene_django/tests/test_query.py +++ b/graphene_django/tests/test_query.py @@ -709,7 +709,8 @@ def test_should_error_if_last_is_greater_than_max(): graphene_settings.RELAY_CONNECTION_ENFORCE_FIRST_OR_LAST = False -def test_should_query_promise_connectionfields(): +@pytest.mark.asyncio +async def test_should_query_promise_connectionfields(): from promise import Promise class ReporterType(DjangoObjectType): @@ -738,7 +739,7 @@ def test_should_query_promise_connectionfields(): expected = {"allReporters": {"edges": [{"node": {"id": "UmVwb3J0ZXJUeXBlOjE="}}]}} - result = schema.execute(query) + result = await schema.execute_async(query) assert not result.errors assert result.data == expected @@ -821,7 +822,8 @@ def test_should_query_connectionfields_with_manager(): assert result.data == expected -def test_should_query_dataloader_fields(): +@pytest.mark.asyncio +async def test_should_query_dataloader_fields(): from promise import Promise from promise.dataloader import DataLoader @@ -914,7 +916,7 @@ def test_should_query_dataloader_fields(): } } - result = schema.execute(query) + result = await schema.execute_async(query) assert not result.errors assert result.data == expected