Skip to content

Commit

Permalink
Pragma no cover in test transport.
Browse files Browse the repository at this point in the history
  • Loading branch information
janiversen committed Oct 26, 2024
1 parent 272a02c commit 04a75ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 1 addition & 4 deletions test/transport/test_comm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, "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
Expand Down
6 changes: 2 additions & 4 deletions test/transport/test_serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,9 @@ async def test_create_serial(self):
assert protocol
transport.close()

@pytest.mark.skipif(SerialTransport.force_poll, "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"
Expand All @@ -94,10 +93,9 @@ async def test_force_poll(self):
transport.close()
SerialTransport.force_poll = False

@pytest.mark.skipif(SerialTransport.force_poll, "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"
Expand Down

0 comments on commit 04a75ac

Please sign in to comment.