From c196fefe31a3946c86d2a8c6021a7c62a6714004 Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Sat, 10 Dec 2022 12:12:56 +0100 Subject: [PATCH] Reduce log level for linger task/timer (#83703) We don't need to warn that loudly for these issues. --- tests/conftest.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 4dc988db8fc..9eb830950fa 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -14,7 +14,6 @@ import ssl import threading from typing import Any from unittest.mock import AsyncMock, MagicMock, Mock, patch -import warnings from aiohttp import client from aiohttp.pytest_plugin import AiohttpClient @@ -212,14 +211,14 @@ def verify_cleanup(event_loop: asyncio.AbstractEventLoop): # before moving on to the next test. tasks = asyncio.all_tasks(event_loop) - tasks_before for task in tasks: - warnings.warn(f"Linger task after test {task}") + _LOGGER.warning("Linger task after test %r", task) task.cancel() if tasks: event_loop.run_until_complete(asyncio.wait(tasks)) for handle in event_loop._scheduled: # pylint: disable=protected-access if not handle.cancelled(): - warnings.warn(f"Lingering timer after test {handle}") + _LOGGER.warning("Lingering timer after test %r", handle) handle.cancel() # Make sure garbage collect run in same test as allocation