Skip to content

Commit 0c1b703

Browse files
committed
Fix aiohttp test client cleanup
1 parent 5ff16ec commit 0c1b703

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
import os
6+
import asyncio
67
import logging
78
from typing import TYPE_CHECKING, Iterator, AsyncIterator
89

@@ -111,3 +112,7 @@ async def async_client(request: FixtureRequest) -> AsyncIterator[AsyncRunloop]:
111112
base_url=base_url, bearer_token=bearer_token, _strict_response_validation=strict, http_client=http_client
112113
) as client:
113114
yield client
115+
116+
# Give async transports a chance to finish closing before pytest collects
117+
# unraisable ResourceWarnings under filterwarnings=error.
118+
await asyncio.sleep(0.1)

0 commit comments

Comments
 (0)