MCPcopy
hub / github.com/urllib3/urllib3 / test_max_connections

Method test_max_connections

test/test_connectionpool.py:220–230  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

218 assert not c.is_same_host(b)
219
220 def test_max_connections(self) -> None:
221 with HTTPConnectionPool(host="localhost", maxsize=1, block=True) as pool:
222 pool._get_conn(timeout=SHORT_TIMEOUT)
223
224 with pytest.raises(EmptyPoolError):
225 pool._get_conn(timeout=SHORT_TIMEOUT)
226
227 with pytest.raises(EmptyPoolError):
228 pool.request("GET", "/", pool_timeout=SHORT_TIMEOUT)
229
230 assert pool.num_connections == 1
231
232 def test_put_conn_when_pool_is_full_nonblocking(
233 self, caplog: pytest.LogCaptureFixture

Callers

nothing calls this directly

Calls 3

HTTPConnectionPoolClass · 0.90
_get_connMethod · 0.80
requestMethod · 0.45

Tested by

no test coverage detected