Description: disable some unittests, which need network access
Author: Martin <debacle@debian.org>
Origin: vendor
Last-Update: 2024-07-11
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/tests/test_client.py
+++ b/tests/test_client.py
@@ -35,7 +35,7 @@
 TOPIC_PREFIX = OS_PY_VERSION + "/tests/aiomqtt/"
 
 
-@pytest.mark.network
+@pytest.mark.skip(reason="needs network access")
 async def test_client_unsubscribe() -> None:
     """Test that messages are no longer received after unsubscribing from a topic."""
     topic_1 = TOPIC_PREFIX + "test_client_unsubscribe/1"
@@ -72,7 +72,7 @@
     assert len(client.identifier) == length
 
 
-@pytest.mark.network
+@pytest.mark.skip(reason="needs network access")
 async def test_client_will() -> None:
     topic = TOPIC_PREFIX + "test_client_will"
     event = anyio.Event()
@@ -93,7 +93,7 @@
             client._client._sock_close()
 
 
-@pytest.mark.network
+@pytest.mark.skip(reason="needs network access")
 async def test_client_tls_context() -> None:
     topic = TOPIC_PREFIX + "test_client_tls_context"
 
@@ -113,7 +113,7 @@
         await client.publish(topic)
 
 
-@pytest.mark.network
+@pytest.mark.skip(reason="needs network access")
 async def test_client_tls_params() -> None:
     topic = TOPIC_PREFIX + "tls_params"
 
@@ -135,7 +135,7 @@
         await client.publish(topic)
 
 
-@pytest.mark.network
+@pytest.mark.skip(reason="needs network access")
 async def test_client_username_password() -> None:
     topic = TOPIC_PREFIX + "username_password"
 
@@ -153,14 +153,14 @@
         await client.publish(topic)
 
 
-@pytest.mark.network
+@pytest.mark.skip(reason="needs network access")
 async def test_client_logger() -> None:
     logger = logging.getLogger("aiomqtt")
     async with Client(HOSTNAME, logger=logger) as client:
         assert logger is client._client._logger
 
 
-@pytest.mark.network
+@pytest.mark.skip(reason="needs network access")
 async def test_client_max_concurrent_outgoing_calls(
     monkeypatch: pytest.MonkeyPatch,
 ) -> None:
@@ -209,7 +209,7 @@
         await client.publish(topic)
 
 
-@pytest.mark.network
+@pytest.mark.skip(reason="needs network access")
 async def test_client_websockets() -> None:
     topic = TOPIC_PREFIX + "websockets"
 
@@ -232,7 +232,7 @@
             await client.publish(topic)
 
 
-@pytest.mark.network
+@pytest.mark.skip(reason="needs network access")
 @pytest.mark.parametrize("pending_calls_threshold", [10, 20])
 async def test_client_pending_calls_threshold(
     pending_calls_threshold: int, caplog: pytest.LogCaptureFixture
@@ -256,7 +256,7 @@
         ]
 
 
-@pytest.mark.network
+@pytest.mark.skip(reason="needs network access")
 @pytest.mark.parametrize("pending_calls_threshold", [10, 20])
 async def test_client_no_pending_calls_warnings_with_max_concurrent_outgoing_calls(
     pending_calls_threshold: int,
@@ -277,7 +277,7 @@
         assert caplog.record_tuples == []
 
 
-@pytest.mark.network
+@pytest.mark.skip(reason="needs network access")
 async def test_client_context_is_reusable() -> None:
     """Test that a client context manager instance is reusable."""
     topic = TOPIC_PREFIX + "test_client_is_reusable"
@@ -288,7 +288,7 @@
         await client.publish(topic, "bar")
 
 
-@pytest.mark.network
+@pytest.mark.skip(reason="needs network access")
 async def test_client_context_is_not_reentrant() -> None:
     """Test that a client context manager instance is not reentrant."""
     client = Client(HOSTNAME)
@@ -298,7 +298,7 @@
                 pass
 
 
-@pytest.mark.network
+@pytest.mark.skip(reason="needs network access")
 async def test_client_reusable_message() -> None:
     custom_client = Client(HOSTNAME)
     publish_client = Client(HOSTNAME)
@@ -333,7 +333,7 @@
             tg.start_soon(task_a_publisher)
 
 
-@pytest.mark.network
+@pytest.mark.skip(reason="needs network access")
 async def test_aenter_state_reset_connect_failure() -> None:
     """Test that internal state is reset on CONNECT failure in ``aenter``."""
     client = Client(hostname="invalid")
@@ -343,7 +343,7 @@
     assert not client._connected.done()
 
 
-@pytest.mark.network
+@pytest.mark.skip(reason="needs network access")
 async def test_aenter_state_reset_connack_timeout() -> None:
     """Test that internal state is reset on CONNACK timeout in ``aenter``."""
     client = Client(HOSTNAME, timeout=0)
@@ -353,7 +353,7 @@
     assert not client._connected.done()
 
 
-@pytest.mark.network
+@pytest.mark.skip(reason="needs network access")
 async def test_aenter_state_reset_connack_negative() -> None:
     """Test that internal state is reset on negative CONNACK in ``aenter``."""
     client = Client(HOSTNAME, username="invalid")
@@ -363,28 +363,28 @@
     assert not client._connected.done()
 
 
-@pytest.mark.network
+@pytest.mark.skip(reason="needs network access")
 async def test_aexit_without_prior_aenter() -> None:
     """Test that ``aexit`` without prior (or unsuccessful) ``aenter`` runs cleanly."""
     client = Client(HOSTNAME)
     await client.__aexit__(None, None, None)
 
 
-@pytest.mark.network
+@pytest.mark.skip(reason="needs network access")
 async def test_aexit_consecutive_calls() -> None:
     """Test that ``aexit`` runs cleanly when it was already called before."""
     async with Client(HOSTNAME) as client:
         await client.__aexit__(None, None, None)
 
 
-@pytest.mark.network
+@pytest.mark.skip(reason="needs network access")
 async def test_aexit_client_is_already_disconnected_success() -> None:
     """Test that ``aexit`` runs cleanly if client is already cleanly disconnected."""
     async with Client(HOSTNAME) as client:
         client._disconnected.set_result(None)
 
 
-@pytest.mark.network
+@pytest.mark.skip(reason="needs network access")
 async def test_aexit_client_is_already_disconnected_failure() -> None:
     """Test that ``aexit`` reraises if client is already disconnected with an error."""
     client = Client(HOSTNAME)
@@ -394,7 +394,7 @@
         await client.__aexit__(None, None, None)
 
 
-@pytest.mark.network
+@pytest.mark.skip(reason="needs network access")
 async def test_messages_view_is_reusable() -> None:
     """Test that ``.messages`` is reusable after dis- and reconnection."""
     topic = TOPIC_PREFIX + "test_messages_generator_is_reusable"
@@ -412,7 +412,7 @@
         assert message.payload == b"foo"
 
 
-@pytest.mark.network
+@pytest.mark.skip(reason="needs network access")
 async def test_messages_view_multiple_tasks_concurrently() -> None:
     """Test that ``.messages`` can be used concurrently by multiple tasks."""
     topic = TOPIC_PREFIX + "test_messages_view_multiple_tasks_concurrently"
@@ -430,7 +430,7 @@
         await client.publish(topic, "bar")
 
 
-@pytest.mark.network
+@pytest.mark.skip(reason="needs network access")
 async def test_messages_view_len() -> None:
     """Test that the ``__len__`` method of the messages view works correctly."""
     topic = TOPIC_PREFIX + "test_messages_view_len"
