We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 305b258 commit c7fd3e5Copy full SHA for c7fd3e5
tests/test_basic.py
@@ -138,9 +138,9 @@ async def listen_for_packets():
138
await harness.send(2, b"one", b"two")
139
await harness.expect(2, b"one", b"two")
140
async with harness.enqueue_packets_to(2, queue_num, forwarded=False):
141
- sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
142
- for payload in (b"three", b"four"):
143
- sock.sendto(payload, harness.dest_addr[2])
+ with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as sock:
+ for payload in (b"three", b"four"):
+ sock.sendto(payload, harness.dest_addr[2])
144
with trio.fail_after(1):
145
while len(hwaddrs) < 4:
146
await trio.sleep(0.1)
0 commit comments