Skip to content

Commit 5dcb36a

Browse files
authored
Fix some missing connector closes in tests (#10956)
1 parent 45b74cf commit 5dcb36a

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

tests/test_client_middleware.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,8 @@ async def blocking_middleware(
793793
# Check that no connections were leaked
794794
assert len(connector._conns) == 0
795795

796+
await connector.close()
797+
796798

797799
async def test_client_middleware_blocks_connection_without_dns_lookup(
798800
aiohttp_server: AiohttpServer,

tests/test_proxy_functional.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ async def test_proxy_http_acquired_cleanup(
463463
assert 0 == len(conn._acquired)
464464

465465
await sess.close()
466+
await conn.close()
466467

467468

468469
@pytest.mark.skip("we need to reconsider how we test this")
@@ -487,6 +488,7 @@ async def request() -> None:
487488
assert 0 == len(conn._acquired)
488489

489490
await sess.close()
491+
await conn.close()
490492

491493

492494
@pytest.mark.skip("we need to reconsider how we test this")
@@ -521,6 +523,7 @@ async def request(pid: int) -> ClientResponse:
521523
assert {resp.status for resp in responses} == {200}
522524

523525
await sess.close()
526+
await conn.close()
524527

525528

526529
@pytest.mark.xfail

tests/test_web_sendfile_functional.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,7 @@ async def test_static_file_ssl(
625625

626626
resp.release()
627627
await client.close()
628+
await conn.close()
628629

629630

630631
async def test_static_file_directory_traversal_attack(

0 commit comments

Comments
 (0)