diff --git a/app/connectors_service/NOTICE.txt b/app/connectors_service/NOTICE.txt index f24893e0b..1c0ba0ae1 100644 --- a/app/connectors_service/NOTICE.txt +++ b/app/connectors_service/NOTICE.txt @@ -1750,7 +1750,7 @@ SOFTWARE. anyio -4.14.2 +4.15.0 MIT The MIT License (MIT) @@ -4241,7 +4241,7 @@ Apache Software License google-auth -2.57.0 +2.57.1 Apache Software License Apache License Version 2.0, January 2004 diff --git a/app/connectors_service/tests/sources/test_s3.py b/app/connectors_service/tests/sources/test_s3.py index 9eb01f897..4d8e50e61 100644 --- a/app/connectors_service/tests/sources/test_s3.py +++ b/app/connectors_service/tests/sources/test_s3.py @@ -494,14 +494,16 @@ async def test_get_content_with_clienterror(): @pytest.mark.asyncio async def test_close_with_client_session(): """Test close method of S3DataSource with client session""" - async with create_s3_source() as source: - source.session = aioboto3.Session() - await source.s3_client.client() - - await source.close() - with pytest.raises(ClientError): - await source.ping() + with ( + mock.patch("aiobotocore.client.AioBaseClient", S3Object), + mock.patch( + "contextlib.AsyncExitStack.aclose", new_callable=mock.AsyncMock + ) as aclose_mock, + ): + await source.s3_client.client() + await source.close() + aclose_mock.assert_awaited_once() @pytest.mark.parametrize(