diff --git a/CHANGES/6663.bugfix b/CHANGES/6663.bugfix new file mode 100644 index 00000000000..ee89799a0e9 --- /dev/null +++ b/CHANGES/6663.bugfix @@ -0,0 +1 @@ +Remove a deprecated usage of pytest.warns(None) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 0432d7b6d80..bd7677f5f29 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -52,6 +52,7 @@ Artem Yushkovskiy Arthur Darcet Austin Scola Ben Bader +Ben Greiner Ben Timby Benedikt Reinartz Bob Haddleton diff --git a/tests/test_client_functional.py b/tests/test_client_functional.py index 1a62048c274..998b22f86bf 100644 --- a/tests/test_client_functional.py +++ b/tests/test_client_functional.py @@ -2444,32 +2444,19 @@ async def close(self): async def test_async_with_session() -> None: - with pytest.warns(None) as cm: - async with aiohttp.ClientSession() as session: - pass - assert len(cm.list) == 0 + async with aiohttp.ClientSession() as session: + pass assert session.closed async def test_session_close_awaitable() -> None: session = aiohttp.ClientSession() - with pytest.warns(None) as cm: - await session.close() - assert len(cm.list) == 0 + await session.close() assert session.closed -async def test_close_run_until_complete_not_deprecated() -> None: - session = aiohttp.ClientSession() - - with pytest.warns(None) as cm: - await session.close() - - assert len(cm.list) == 0 - - async def test_close_resp_on_error_async_with_session(aiohttp_server: Any) -> None: async def handler(request): resp = web.StreamResponse(headers={"content-length": "100"})