MCPcopy
hub / github.com/urllib3/urllib3 / test_pool_timeouts

Method test_pool_timeouts

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

Source from the content-addressed store, hash-verified

414 pytest.fail("Pool of the ConnectionPool is None and has no attribute get.")
415
416 def test_pool_timeouts(self) -> None:
417 with HTTPConnectionPool(host="localhost") as pool:
418 conn = pool._new_conn()
419 assert conn.__class__ == HTTPConnection
420 assert pool.timeout.__class__ == Timeout
421 assert pool.timeout._read == _DEFAULT_TIMEOUT
422 assert pool.timeout._connect == _DEFAULT_TIMEOUT
423 assert pool.timeout.total is None
424
425 pool = HTTPConnectionPool(host="localhost", timeout=SHORT_TIMEOUT)
426 assert pool.timeout._read == SHORT_TIMEOUT
427 assert pool.timeout._connect == SHORT_TIMEOUT
428 assert pool.timeout.total is None
429
430 def test_no_host(self) -> None:
431 with pytest.raises(LocationValueError):

Callers

nothing calls this directly

Calls 2

_new_connMethod · 0.95
HTTPConnectionPoolClass · 0.90

Tested by

no test coverage detected