(pool: HTTPConnectionPool)
| 53 | |
| 54 | |
| 55 | def 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 | |
| 70 | def test_double_getresponse(pool: HTTPConnectionPool) -> None: |
nothing calls this directly
no test coverage detected