Skip to content

Commit

Permalink
more coverage in test_dtls
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Dec 19, 2024
1 parent 8501b0c commit be08460
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/trio/_tests/test_dtls.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,18 @@ async def test_smoke(ipv6: bool) -> None:
assert client_channel.get_cleartext_mtu() == cleartext_mtu_1234


@parametrize_ipv6
async def test_smoke_close_immediately(ipv6: bool) -> None:
# used to get 100% branch coverage in this file itself
async with dtls_echo_server(ipv6=ipv6) as (_server_endpoint, address):
with endpoint(ipv6=ipv6) as client_endpoint:
client_channel = client_endpoint.connect(address, client_ctx)
with pytest.raises(trio.NeedHandshakeError):
client_channel.get_cleartext_mtu()

await client_channel.do_handshake()


@slow
async def test_handshake_over_terrible_network(
autojump_clock: trio.testing.MockClock,
Expand Down

0 comments on commit be08460

Please sign in to comment.