From f1fb25d59e26a3d83e7aa35f0ae5660a94a79976 Mon Sep 17 00:00:00 2001 From: Leszek Hanusz Date: Sat, 13 Jul 2024 18:44:52 +0200 Subject: [PATCH] Add the aiohttp AND websockets mark to the aiohttp_websocket tests --- tests/test_aiohttp_websocket_exceptions.py | 4 ++-- tests/test_aiohttp_websocket_graphql_exceptions.py | 4 ++-- tests/test_aiohttp_websocket_graphql_subscription.py | 4 ++-- tests/test_aiohttp_websocket_query.py | 4 ++-- tests/test_aiohttp_websocket_subscription.py | 7 +++---- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/tests/test_aiohttp_websocket_exceptions.py b/tests/test_aiohttp_websocket_exceptions.py index 48312544..7c1b35ed 100644 --- a/tests/test_aiohttp_websocket_exceptions.py +++ b/tests/test_aiohttp_websocket_exceptions.py @@ -15,8 +15,8 @@ from .conftest import MS, WebSocketServerHelper -# Marking all tests in this file with the websockets marker -pytestmark = pytest.mark.aiohttp_websockets +# Marking all tests in this file with the aiohttp AND websockets marker +pytestmark = [pytest.mark.aiohttp, pytest.mark.websockets] invalid_query_str = """ query getContinents { diff --git a/tests/test_aiohttp_websocket_graphql_exceptions.py b/tests/test_aiohttp_websocket_graphql_exceptions.py index d49ee7d0..577ddc6b 100644 --- a/tests/test_aiohttp_websocket_graphql_exceptions.py +++ b/tests/test_aiohttp_websocket_graphql_exceptions.py @@ -12,8 +12,8 @@ from .conftest import WebSocketServerHelper -# Marking all tests in this file with the websockets marker -pytestmark = pytest.mark.aiohttp_websockets +# Marking all tests in this file with the aiohttp AND websockets marker +pytestmark = [pytest.mark.aiohttp, pytest.mark.websockets] invalid_query_str = """ query getContinents { diff --git a/tests/test_aiohttp_websocket_graphql_subscription.py b/tests/test_aiohttp_websocket_graphql_subscription.py index 1c3348bc..bb5529a1 100644 --- a/tests/test_aiohttp_websocket_graphql_subscription.py +++ b/tests/test_aiohttp_websocket_graphql_subscription.py @@ -12,8 +12,8 @@ from .conftest import MS, WebSocketServerHelper -# Marking all tests in this file with the websockets marker -pytestmark = pytest.mark.aiohttp_websockets +# Marking all tests in this file with the aiohttp AND websockets marker +pytestmark = [pytest.mark.aiohttp, pytest.mark.websockets] countdown_server_answer = ( '{{"type":"next","id":"{query_id}","payload":{{"data":{{"number":{number}}}}}}}' diff --git a/tests/test_aiohttp_websocket_query.py b/tests/test_aiohttp_websocket_query.py index 2899038e..e119af5a 100644 --- a/tests/test_aiohttp_websocket_query.py +++ b/tests/test_aiohttp_websocket_query.py @@ -16,8 +16,8 @@ from .conftest import MS, WebSocketServerHelper -# Marking all tests in this file with the websockets marker -pytestmark = pytest.mark.aiohttp_websockets +# Marking all tests in this file with the aiohttp AND websockets marker +pytestmark = [pytest.mark.aiohttp, pytest.mark.websockets] query1_str = """ query getContinents { diff --git a/tests/test_aiohttp_websocket_subscription.py b/tests/test_aiohttp_websocket_subscription.py index e41a320b..1eaf7c98 100644 --- a/tests/test_aiohttp_websocket_subscription.py +++ b/tests/test_aiohttp_websocket_subscription.py @@ -14,6 +14,9 @@ from .conftest import MS, WebSocketServerHelper from .starwars.schema import StarWarsIntrospection, StarWarsSchema, StarWarsTypeDef +# Marking all tests in this file with the aiohttp AND websockets marker +pytestmark = [pytest.mark.aiohttp, pytest.mark.websockets] + starwars_expected_one = { "stars": 3, "commentary": "Was expecting more stuff", @@ -77,9 +80,6 @@ async def server_starwars(ws, path): } """ -# Marking all tests in this file with the websockets marker -pytestmark = pytest.mark.aiohttp_websockets - countdown_server_answer = ( '{{"type":"data","id":"{query_id}","payload":{{"data":{{"number":{number}}}}}}}' ) @@ -711,7 +711,6 @@ def test_code(): await run_sync_test(event_loop, server, test_code) -@pytest.mark.aiohttp_websockets @pytest.mark.asyncio @pytest.mark.parametrize("server", [server_starwars], indirect=True) @pytest.mark.parametrize("subscription_str", [starwars_subscription_str])