We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8751ff4 commit ec5eb34Copy full SHA for ec5eb34
tests/test_connector.py
@@ -1921,6 +1921,15 @@ async def test_cleanup_closed(
1921
assert cleanup_closed_handle.cancel.called
1922
1923
1924
+async def test_cleanup_closed_is_noop_on_fixed_cpython() -> None:
1925
+ """Ensure that enable_cleanup_closed is a noop on fixed Python versions."""
1926
+ with mock.patch("aiohttp.connector.NEEDS_CLEANUP_CLOSED", False), pytest.warns(
1927
+ DeprecationWarning, match="cleanup_closed ignored"
1928
+ ):
1929
+ conn = aiohttp.BaseConnector(enable_cleanup_closed=True)
1930
+ assert conn._cleanup_closed_disabled is True
1931
+
1932
1933
async def test_cleanup_closed_disabled(
1934
loop: asyncio.AbstractEventLoop, mocker: MockerFixture
1935
) -> None:
0 commit comments