Skip to content

Commit 42cb70e

Browse files
authored
PYTHON-5341 Fix handling of SSL tests with Stable API (#2305)
1 parent 09897b6 commit 42cb70e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

test/asynchronous/test_ssl.py

+6
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,14 @@ async def asyncTearDown(self):
166166

167167
@async_client_context.require_tls
168168
async def test_simple_ssl(self):
169+
if "PyPy" in sys.version:
170+
self.skipTest("Test is flaky on PyPy")
169171
# Expects the server to be running with ssl and with
170172
# no --sslPEMKeyFile or with --sslWeakCertificateValidation
171173
await self.assertClientWorks(self.client)
172174

173175
@async_client_context.require_tlsCertificateKeyFile
176+
@async_client_context.require_no_api_version
174177
@ignore_deprecations
175178
async def test_tlsCertificateKeyFilePassword(self):
176179
# Expects the server to be running with server.pem and ca.pem
@@ -376,6 +379,7 @@ async def test_cert_ssl_validation_hostname_matching(self):
376379
)
377380

378381
@async_client_context.require_tlsCertificateKeyFile
382+
@async_client_context.require_no_api_version
379383
@ignore_deprecations
380384
async def test_tlsCRLFile_support(self):
381385
if not hasattr(ssl, "VERIFY_CRL_CHECK_LEAF") or _ssl.IS_PYOPENSSL:
@@ -531,6 +535,7 @@ def test_wincertstore(self):
531535

532536
@async_client_context.require_auth
533537
@async_client_context.require_tlsCertificateKeyFile
538+
@async_client_context.require_no_api_version
534539
@ignore_deprecations
535540
async def test_mongodb_x509_auth(self):
536541
host, port = await async_client_context.host, await async_client_context.port
@@ -640,6 +645,7 @@ async def test_mongodb_x509_auth(self):
640645
self.fail("Invalid certificate accepted.")
641646

642647
@async_client_context.require_tlsCertificateKeyFile
648+
@async_client_context.require_no_api_version
643649
@ignore_deprecations
644650
async def test_connect_with_ca_bundle(self):
645651
def remove(path):

test/test_ssl.py

+6
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,14 @@ def tearDown(self):
166166

167167
@client_context.require_tls
168168
def test_simple_ssl(self):
169+
if "PyPy" in sys.version:
170+
self.skipTest("Test is flaky on PyPy")
169171
# Expects the server to be running with ssl and with
170172
# no --sslPEMKeyFile or with --sslWeakCertificateValidation
171173
self.assertClientWorks(self.client)
172174

173175
@client_context.require_tlsCertificateKeyFile
176+
@client_context.require_no_api_version
174177
@ignore_deprecations
175178
def test_tlsCertificateKeyFilePassword(self):
176179
# Expects the server to be running with server.pem and ca.pem
@@ -376,6 +379,7 @@ def test_cert_ssl_validation_hostname_matching(self):
376379
)
377380

378381
@client_context.require_tlsCertificateKeyFile
382+
@client_context.require_no_api_version
379383
@ignore_deprecations
380384
def test_tlsCRLFile_support(self):
381385
if not hasattr(ssl, "VERIFY_CRL_CHECK_LEAF") or _ssl.IS_PYOPENSSL:
@@ -531,6 +535,7 @@ def test_wincertstore(self):
531535

532536
@client_context.require_auth
533537
@client_context.require_tlsCertificateKeyFile
538+
@client_context.require_no_api_version
534539
@ignore_deprecations
535540
def test_mongodb_x509_auth(self):
536541
host, port = client_context.host, client_context.port
@@ -640,6 +645,7 @@ def test_mongodb_x509_auth(self):
640645
self.fail("Invalid certificate accepted.")
641646

642647
@client_context.require_tlsCertificateKeyFile
648+
@client_context.require_no_api_version
643649
@ignore_deprecations
644650
def test_connect_with_ca_bundle(self):
645651
def remove(path):

0 commit comments

Comments
 (0)