(
loop: asyncio.AbstractEventLoop, ssl_key: ConnectionKey
)
| 499 | |
| 500 | @pytest.mark.usefixtures("enable_cleanup_closed") |
| 501 | async def test_release_ssl_transport( |
| 502 | loop: asyncio.AbstractEventLoop, ssl_key: ConnectionKey |
| 503 | ) -> None: |
| 504 | conn = aiohttp.BaseConnector(enable_cleanup_closed=True) |
| 505 | with mock.patch.object(conn, "_release_waiter", autospec=True, spec_set=True): |
| 506 | proto = create_mocked_conn(loop) |
| 507 | transport = proto.transport |
| 508 | conn._acquired.add(proto) |
| 509 | conn._acquired_per_host[ssl_key].add(proto) |
| 510 | |
| 511 | proto = mock.Mock() |
| 512 | transport = proto.transport |
| 513 | conn._acquired.add(proto) |
| 514 | conn._acquired_per_host[ssl_key].add(proto) |
| 515 | |
| 516 | conn._release(ssl_key, proto, should_close=True) |
| 517 | assert conn._cleanup_closed_transports == [transport] |
| 518 | await conn.close() |
| 519 | |
| 520 | |
| 521 | async def test_release_already_closed(loop) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…