Skip to content

Commit e61d130

Browse files
committed
PYTHON-5006 Skip test_kms_retry withn using PyOpenSSL
1 parent dc34833 commit e61d130

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

test/asynchronous/test_encryption.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
from pymongo.asynchronous.collection import AsyncCollection
4242
from pymongo.asynchronous.helpers import anext
4343
from pymongo.daemon import _spawn_daemon
44+
from pymongo.pyopenssl_context import IS_PYOPENSSL
4445

4546
sys.path[0:0] = [""]
4647

@@ -2860,6 +2861,7 @@ class TestKmsRetryProse(AsyncEncryptionIntegrationTest):
28602861
@unittest.skipUnless(any(AWS_CREDS.values()), "AWS environment credentials are not set")
28612862
async def asyncSetUp(self):
28622863
await super().asyncSetUp()
2864+
28632865
# 1, create client with only tlsCAFile.
28642866
providers: dict = copy.deepcopy(ALL_KMS_PROVIDERS)
28652867
providers["azure"]["identityPlatformEndpoint"] = "127.0.0.1:9003"
@@ -2921,6 +2923,10 @@ async def _test(self, provider, master_key):
29212923
await self.client_encryption.create_data_key(provider, master_key=master_key)
29222924

29232925
async def test_kms_retry(self):
2926+
if IS_PYOPENSSL:
2927+
self.skipTest(
2928+
"PyOpenSSL does not support a required method for this test, Connection.makefile"
2929+
)
29242930
await self._test("aws", {"region": "foo", "key": "bar", "endpoint": "127.0.0.1:9003"})
29252931
await self._test("azure", {"keyVaultEndpoint": "127.0.0.1:9003", "keyName": "foo"})
29262932
await self._test(

test/test_encryption.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import pytest
4040

4141
from pymongo.daemon import _spawn_daemon
42+
from pymongo.pyopenssl_context import IS_PYOPENSSL
4243
from pymongo.synchronous.collection import Collection
4344
from pymongo.synchronous.helpers import next
4445

@@ -2842,6 +2843,7 @@ class TestKmsRetryProse(EncryptionIntegrationTest):
28422843
@unittest.skipUnless(any(AWS_CREDS.values()), "AWS environment credentials are not set")
28432844
def setUp(self):
28442845
super().setUp()
2846+
28452847
# 1, create client with only tlsCAFile.
28462848
providers: dict = copy.deepcopy(ALL_KMS_PROVIDERS)
28472849
providers["azure"]["identityPlatformEndpoint"] = "127.0.0.1:9003"
@@ -2903,6 +2905,10 @@ def _test(self, provider, master_key):
29032905
self.client_encryption.create_data_key(provider, master_key=master_key)
29042906

29052907
def test_kms_retry(self):
2908+
if IS_PYOPENSSL:
2909+
self.skipTest(
2910+
"PyOpenSSL does not support a required method for this test, Connection.makefile"
2911+
)
29062912
self._test("aws", {"region": "foo", "key": "bar", "endpoint": "127.0.0.1:9003"})
29072913
self._test("azure", {"keyVaultEndpoint": "127.0.0.1:9003", "keyName": "foo"})
29082914
self._test(

0 commit comments

Comments
 (0)