diff --git a/bindings/python/.evergreen/test.sh b/bindings/python/.evergreen/test.sh index 288ff9af1..0e5b68222 100755 --- a/bindings/python/.evergreen/test.sh +++ b/bindings/python/.evergreen/test.sh @@ -51,12 +51,10 @@ else export CRYPT_SHARED_PATH="../crypt_shared/lib/mongo_crypt_v1.so" MACHINE=$(uname -m) if [ $MACHINE == "aarch64" ]; then - TARGET=rhel82 PYTHONS=("/opt/mongodbtoolchain/v3/bin/python3" "/opt/mongodbtoolchain/v4/bin/python3" ) else - TARGET=rhel80 PYTHONS=("/opt/python/3.8/bin/python3" "/opt/python/3.9/bin/python3" "/opt/python/3.10/bin/python3" @@ -66,7 +64,7 @@ else ) fi /opt/mongodbtoolchain/v3/bin/python3 drivers-evergreen-tools/.evergreen/mongodl.py --component \ - crypt_shared --version latest --out ../crypt_shared/ --target $TARGET + crypt_shared --version latest --out ../crypt_shared/ fi for PYTHON_BINARY in "${PYTHONS[@]}"; do diff --git a/bindings/python/test/test_mongocrypt.py b/bindings/python/test/test_mongocrypt.py index a9cca34d2..1160c7390 100644 --- a/bindings/python/test/test_mongocrypt.py +++ b/bindings/python/test/test_mongocrypt.py @@ -607,7 +607,7 @@ def test_need_kms_gcp_credentials(self): encrypter = AutoEncrypter(callback, opts) self.addCleanup(encrypter.close) - with respx.mock() as router: + with respx.mock(using="httpx") as router: data = {"access_token": "foo"} url = "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token" router.add( @@ -748,7 +748,7 @@ async def test_need_kms_gcp_credentials(self): encrypter = AsyncAutoEncrypter(callback, opts) self.addAsyncCleanup(encrypter.close) - with respx.mock() as router: + with respx.mock(using="httpx") as router: data = {"access_token": "foo"} url = "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token" router.add( @@ -1019,7 +1019,7 @@ def get_encrypter(self, clear_cache=True): def test_success(self): encrypter = self.get_encrypter() - with respx.mock() as router: + with respx.mock(using="httpx") as router: data = {"access_token": "foo", "expires_in": 4000} url = "http://169.254.169.254/metadata/identity/oauth2/token" router.add( @@ -1034,7 +1034,7 @@ def test_success(self): def test_empty_json(self): encrypter = self.get_encrypter() - with respx.mock() as router: + with respx.mock(using="httpx") as router: url = "http://169.254.169.254/metadata/identity/oauth2/token" router.add( respx.get(url=url).mock(return_value=httpx.Response(200, json={})) @@ -1048,7 +1048,7 @@ def test_empty_json(self): def test_bad_json(self): encrypter = self.get_encrypter() - with respx.mock() as router: + with respx.mock(using="httpx") as router: url = "http://169.254.169.254/metadata/identity/oauth2/token" router.add( respx.get(url=url).mock(return_value=httpx.Response(200, text="a'")) @@ -1062,7 +1062,7 @@ def test_bad_json(self): def test_http_404(self): encrypter = self.get_encrypter() - with respx.mock() as router: + with respx.mock(using="httpx") as router: url = "http://169.254.169.254/metadata/identity/oauth2/token" router.add(respx.get(url=url).mock(return_value=httpx.Response(404))) with self.assertRaisesRegex( @@ -1074,7 +1074,7 @@ def test_http_404(self): def test_http_500(self): encrypter = self.get_encrypter() - with respx.mock() as router: + with respx.mock(using="httpx") as router: url = "http://169.254.169.254/metadata/identity/oauth2/token" router.add(respx.get(url=url).mock(return_value=httpx.Response(500))) with self.assertRaisesRegex( @@ -1086,7 +1086,7 @@ def test_http_500(self): def test_slow_response(self): encrypter = self.get_encrypter() - with respx.mock() as router: + with respx.mock(using="httpx") as router: url = "http://169.254.169.254/metadata/identity/oauth2/token" router.add( respx.get(url=url).mock(side_effect=httpx._exceptions.ConnectTimeout) @@ -1100,7 +1100,7 @@ def test_slow_response(self): def test_cache(self): encrypter = self.get_encrypter() - with respx.mock() as router: + with respx.mock(using="httpx") as router: data = {"access_token": "foo", "expires_in": 4000} url = "http://169.254.169.254/metadata/identity/oauth2/token" router.add( @@ -1121,7 +1121,7 @@ def test_cache(self): def test_cache_expires_soon(self): encrypter = self.get_encrypter() - with respx.mock() as router: + with respx.mock(using="httpx") as router: data = {"access_token": "foo", "expires_in": 10} url = "http://169.254.169.254/metadata/identity/oauth2/token" router.add( @@ -1137,7 +1137,7 @@ def test_cache_expires_soon(self): # Should not use the cached value. encrypter = self.get_encrypter(False) self.assertIsNotNone(pymongocrypt.synchronous.credentials._azure_creds_cache) - with respx.mock() as router: + with respx.mock(using="httpx") as router: url = "http://169.254.169.254/metadata/identity/oauth2/token" router.add( respx.get(url=url).mock(side_effect=httpx._exceptions.ConnectTimeout)