(self)
| 432 | HTTPConnectionPool(None) # type: ignore[arg-type] |
| 433 | |
| 434 | def test_contextmanager(self) -> None: |
| 435 | with connection_from_url("http://google.com:80") as pool: |
| 436 | # Populate with some connections |
| 437 | conn1 = pool._get_conn() |
| 438 | conn2 = pool._get_conn() |
| 439 | conn3 = pool._get_conn() |
| 440 | pool._put_conn(conn1) |
| 441 | pool._put_conn(conn2) |
| 442 | |
| 443 | old_pool_queue = pool.pool |
| 444 | |
| 445 | assert pool.pool is None |
| 446 | with pytest.raises(ClosedPoolError): |
| 447 | pool._get_conn() |
| 448 | |
| 449 | pool._put_conn(conn3) |
| 450 | with pytest.raises(ClosedPoolError): |
| 451 | pool._get_conn() |
| 452 | with pytest.raises(Empty): |
| 453 | assert old_pool_queue is not None |
| 454 | old_pool_queue.get(block=False) |
| 455 | |
| 456 | def test_url_from_pool(self) -> None: |
| 457 | with connection_from_url("http://google.com:80") as pool: |
nothing calls this directly
no test coverage detected