MCPcopy
hub / github.com/urllib3/urllib3 / test_pool_close_twice

Method test_pool_close_twice

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

Source from the content-addressed store, hash-verified

397 old_pool_queue.get(block=False)
398
399 def test_pool_close_twice(self) -> None:
400 pool = connection_from_url("http://google.com:80")
401
402 # Populate with some connections
403 conn1 = pool._get_conn()
404 conn2 = pool._get_conn()
405 pool._put_conn(conn1)
406 pool._put_conn(conn2)
407
408 pool.close()
409 assert pool.pool is None
410
411 try:
412 pool.close()
413 except AttributeError:
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:

Callers

nothing calls this directly

Calls 4

connection_from_urlFunction · 0.90
_get_connMethod · 0.80
_put_connMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected