Skip to content

Commit f781696

Browse files
author
rodrigo.nogueira
committed
fix: suppress unraisable exception warnings on Windows for Python 3.10/3.11 and refactor asyncio.gather calls to use generator expressions.
1 parent a07489e commit f781696

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/conftest.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@
5050

5151

5252
def pytest_configure(config: pytest.Config) -> None:
53+
# On Windows with Python 3.10/3.11, proxy.py's threaded mode can leave
54+
# sockets not fully released by the time pytest's unraisableexception
55+
# plugin collects warnings during teardown. Suppress these warnings
56+
# since they are not actionable and only affect older Python versions.
5357
if os.name == "nt" and sys.version_info[:2] in ((3, 10), (3, 11)):
5458
config.addinivalue_line(
5559
"filterwarnings",
@@ -477,8 +481,8 @@ def maker(
477481
yield maker
478482

479483
await asyncio.gather(
480-
*[request._close() for request in requests],
481-
*[session.close() for session in sessions],
484+
*(request._close() for request in requests),
485+
*(session.close() for session in sessions),
482486
)
483487

484488

0 commit comments

Comments
 (0)