Skip to content

Commit

Permalink
Use udp_port fixtures from pytest-asyncio
Browse files Browse the repository at this point in the history
  • Loading branch information
nocarryr committed Dec 22, 2023
1 parent 4dadcda commit bea2c5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ def uhs500_msg_parsed() -> Message:
return Message(**data)

@pytest.fixture
def udp_port0(unused_tcp_port_factory):
return unused_tcp_port_factory()
def udp_port0(unused_udp_port_factory):
return unused_udp_port_factory()

@pytest.fixture
def udp_port(unused_tcp_port_factory):
return unused_tcp_port_factory()
def udp_port(unused_udp_port_factory):
return unused_udp_port_factory()
4 changes: 2 additions & 2 deletions tests/test_receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ async def test_rebind(
uhs500_msg_parsed,
udp_endpoint,
udp_port,
unused_tcp_port_factory,
unused_udp_port_factory,
non_loopback_hostaddr
):
transport, protocol, endpoint_port = udp_endpoint
Expand Down Expand Up @@ -207,7 +207,7 @@ async def test_rebind(
assert disp == evt_tally

# Change bind port and trigger a change
new_port = unused_tcp_port_factory()
new_port = unused_udp_port_factory()
assert new_port != udp_port

await receiver.set_hostport(new_port)
Expand Down

0 comments on commit bea2c5c

Please sign in to comment.