diff --git a/test_opensearchpy/test_async/test_connection.py b/test_opensearchpy/test_async/test_connection.py index 9ad21b5d..1b4e8100 100644 --- a/test_opensearchpy/test_async/test_connection.py +++ b/test_opensearchpy/test_async/test_connection.py @@ -29,6 +29,7 @@ import io import json import ssl +import sys import warnings from platform import python_version from typing import Any @@ -228,7 +229,13 @@ async def test_nowarn_when_test_uses_https_if_verify_certs_is_off(self) -> None: use_ssl=True, verify_certs=False, ssl_show_warn=False ) await con._create_aiohttp_session() - assert w == [] + if sys.hexversion < 0x30c0700: + assert w == [] + else: + assert len(w) == 1 + assert (str(w[0].message) == "enable_cleanup_closed ignored because " + "https://github.com/python/cpython/pull/118960 is fixed in " + "Python version sys.version_info(major=3, minor=12, micro=7, releaselevel='final', serial=0)") assert isinstance(con.session, aiohttp.ClientSession)