MCPcopy
hub / github.com/urllib3/urllib3 / test_releases_conn

Function test_releases_conn

test/with_dummyserver/test_connection.py:55–67  ·  view source on GitHub ↗
(pool: HTTPConnectionPool)

Source from the content-addressed store, hash-verified

53
54
55def test_releases_conn(pool: HTTPConnectionPool) -> None:
56 with contextlib.closing(pool._get_conn()) as conn:
57 conn.request("GET", "/")
58 response = conn.getresponse()
59
60 # If these variables are set by the pool
61 # then the response can release the connection
62 # back into the pool.
63 response._pool = pool # type: ignore[attr-defined]
64 response._connection = conn # type: ignore[attr-defined]
65
66 response.release_conn()
67 assert pool.pool.qsize() == 1 # type: ignore[union-attr]
68
69
70def test_double_getresponse(pool: HTTPConnectionPool) -> None:

Callers

nothing calls this directly

Calls 4

_get_connMethod · 0.80
requestMethod · 0.45
getresponseMethod · 0.45
release_connMethod · 0.45

Tested by

no test coverage detected