MCPcopy
hub / github.com/urllib3/urllib3 / test_wait_for_read_write

Function test_wait_for_read_write

test/test_wait.py:82–102  ·  view source on GitHub ↗
(spair: TYPE_SOCKET_PAIR)

Source from the content-addressed store, hash-verified

80
81
82def test_wait_for_read_write(spair: TYPE_SOCKET_PAIR) -> None:
83 a, b = spair
84
85 assert not wait_for_read(a, 0)
86 assert wait_for_write(a, 0)
87
88 b.send(b"x")
89
90 assert wait_for_read(a, 0)
91 assert wait_for_write(a, 0)
92
93 # Fill up the socket with data
94 a.setblocking(False)
95 try:
96 while True:
97 a.send(b"x" * 999999)
98 except OSError:
99 pass
100
101 # Now it's not writable anymore
102 assert not wait_for_write(a, 0)
103
104
105@pytest.mark.skipif(not hasattr(signal, "setitimer"), reason="need setitimer() support")

Callers

nothing calls this directly

Calls 3

wait_for_readFunction · 0.90
wait_for_writeFunction · 0.90
sendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…