diff --git a/test/transport/test_comm.py b/test/transport/test_comm.py index 2639b3b993..30844425e7 100644 --- a/test/transport/test_comm.py +++ b/test/transport/test_comm.py @@ -172,12 +172,9 @@ async def test_split_serial_packet(self, client, server, use_port): (CommType.SERIAL, "socket://localhost:7300"), ], ) + @pytest.mark.skipif(SerialTransport.force_poll, reason="Serial poll not supported") async def test_serial_poll(self, client, server, use_port): """Test connection and data exchange.""" - if SerialTransport.force_poll: # pragma: no cover - client.close() - server.close() - return Log.debug("test_serial_poll {}", use_port) assert await server.listen() SerialTransport.force_poll = True diff --git a/test/transport/test_serial.py b/test/transport/test_serial.py index 0d7e7497d9..acf73c9cdc 100644 --- a/test/transport/test_serial.py +++ b/test/transport/test_serial.py @@ -80,10 +80,9 @@ async def test_create_serial(self): assert protocol transport.close() + @pytest.mark.skipif(SerialTransport.force_poll, reason="Serial poll not supported") async def test_force_poll(self): """Test external methods.""" - if SerialTransport.force_poll: # pragma: no cover - return SerialTransport.force_poll = True transport, protocol = await create_serial_connection( asyncio.get_running_loop(), mock.Mock, "dummy" @@ -94,10 +93,9 @@ async def test_force_poll(self): transport.close() SerialTransport.force_poll = False + @pytest.mark.skipif(SerialTransport.force_poll, reason="Serial poll not supported") async def test_write_force_poll(self): """Test write with poll.""" - if SerialTransport.force_poll: # pragma: no cover - return SerialTransport.force_poll = True transport, protocol = await create_serial_connection( asyncio.get_running_loop(), mock.Mock, "dummy"