Skip to content

Commit a40f497

Browse files
committed
fix check
1 parent 1449f5d commit a40f497

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

test/asynchronous/test_encryption.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@
4141
from pymongo.asynchronous.collection import AsyncCollection
4242
from pymongo.asynchronous.helpers import anext
4343
from pymongo.daemon import _spawn_daemon
44-
from pymongo.ssl_context import _ssl
44+
45+
try:
46+
from pymongo.pyopenssl_context import IS_PYOPENSSL
47+
except ImportError:
48+
IS_PYOPENSSL = False
4549

4650
sys.path[0:0] = [""]
4751

@@ -2922,7 +2926,7 @@ async def _test(self, provider, master_key):
29222926
await self.client_encryption.create_data_key(provider, master_key=master_key)
29232927

29242928
async def test_kms_retry(self):
2925-
if _ssl.IS_PYOPENSSL:
2929+
if IS_PYOPENSSL:
29262930
self.skipTest(
29272931
"PyOpenSSL does not support a required method for this test, Connection.makefile"
29282932
)

test/test_encryption.py

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

4141
from pymongo.daemon import _spawn_daemon
42-
from pymongo.ssl_context import _ssl
4342
from pymongo.synchronous.collection import Collection
4443
from pymongo.synchronous.helpers import next
4544

45+
try:
46+
from pymongo.pyopenssl_context import IS_PYOPENSSL
47+
except ImportError:
48+
IS_PYOPENSSL = False
49+
4650
sys.path[0:0] = [""]
4751

4852
from test import (
@@ -2904,7 +2908,7 @@ def _test(self, provider, master_key):
29042908
self.client_encryption.create_data_key(provider, master_key=master_key)
29052909

29062910
def test_kms_retry(self):
2907-
if _ssl.IS_PYOPENSSL:
2911+
if IS_PYOPENSSL:
29082912
self.skipTest(
29092913
"PyOpenSSL does not support a required method for this test, Connection.makefile"
29102914
)

0 commit comments

Comments
 (0)