(
exception: type[BaseException],
expect: type[BaseException],
reason: type[BaseException] | None = None,
)
| 322 | ) as pool: |
| 323 | |
| 324 | def _test( |
| 325 | exception: type[BaseException], |
| 326 | expect: type[BaseException], |
| 327 | reason: type[BaseException] | None = None, |
| 328 | ) -> None: |
| 329 | with patch.object(pool, "_make_request", side_effect=exception()): |
| 330 | with pytest.raises(expect) as excinfo: |
| 331 | pool.request("GET", "/") |
| 332 | if reason is not None: |
| 333 | assert isinstance(excinfo.value.reason, reason) # type: ignore[attr-defined] |
| 334 | assert pool.pool is not None |
| 335 | assert pool.pool.qsize() == POOL_SIZE |
| 336 | |
| 337 | # Make sure that all of the exceptions return the connection |
| 338 | # to the pool |
nothing calls this directly
no test coverage detected