Skip to content

Commit 4caa07f

Browse files
committed
fix api require version tests
1 parent 5336943 commit 4caa07f

File tree

4 files changed

+8
-16
lines changed

4 files changed

+8
-16
lines changed

test/__init__.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,10 +1138,6 @@ def rs_or_single_client(self, h: Any = None, p: Any = None, **kwargs: Any) -> Mo
11381138
return self._async_mongo_client(h, p, **kwargs)
11391139

11401140
def simple_client(self, h: Any = None, p: Any = None, **kwargs: Any) -> MongoClient:
1141-
client_options: dict = client_context.default_client_options.copy()
1142-
kwargs = kwargs.copy()
1143-
for key, value in client_options.items():
1144-
kwargs.setdefault(key, value)
11451141
if not h and not p:
11461142
client = MongoClient(**kwargs)
11471143
else:
@@ -1151,10 +1147,6 @@ def simple_client(self, h: Any = None, p: Any = None, **kwargs: Any) -> MongoCli
11511147

11521148
@classmethod
11531149
def unmanaged_simple_client(cls, h: Any = None, p: Any = None, **kwargs: Any) -> MongoClient:
1154-
client_options: dict = client_context.default_client_options.copy()
1155-
kwargs = kwargs.copy()
1156-
for key, value in client_options.items():
1157-
kwargs.setdefault(key, value)
11581150
if not h and not p:
11591151
client = MongoClient(**kwargs)
11601152
else:

test/asynchronous/__init__.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,10 +1154,6 @@ async def async_rs_or_single_client(
11541154
return await self._async_mongo_client(h, p, **kwargs)
11551155

11561156
def simple_client(self, h: Any = None, p: Any = None, **kwargs: Any) -> AsyncMongoClient:
1157-
client_options: dict = async_client_context.default_client_options.copy()
1158-
kwargs = kwargs.copy()
1159-
for key, value in client_options.items():
1160-
kwargs.setdefault(key, value)
11611157
if not h and not p:
11621158
client = AsyncMongoClient(**kwargs)
11631159
else:
@@ -1169,10 +1165,6 @@ def simple_client(self, h: Any = None, p: Any = None, **kwargs: Any) -> AsyncMon
11691165
def unmanaged_simple_client(
11701166
cls, h: Any = None, p: Any = None, **kwargs: Any
11711167
) -> AsyncMongoClient:
1172-
client_options: dict = async_client_context.default_client_options.copy()
1173-
kwargs = kwargs.copy()
1174-
for key, value in client_options.items():
1175-
kwargs.setdefault(key, value)
11761168
if not h and not p:
11771169
client = AsyncMongoClient(**kwargs)
11781170
else:

test/asynchronous/test_ssl.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ async def test_simple_ssl(self):
171171
await self.assertClientWorks(self.client)
172172

173173
@async_client_context.require_tlsCertificateKeyFile
174+
@async_client_context.require_no_api_version
174175
@ignore_deprecations
175176
async def test_tlsCertificateKeyFilePassword(self):
176177
# Expects the server to be running with server.pem and ca.pem
@@ -376,6 +377,7 @@ async def test_cert_ssl_validation_hostname_matching(self):
376377
)
377378

378379
@async_client_context.require_tlsCertificateKeyFile
380+
@async_client_context.require_no_api_version
379381
@ignore_deprecations
380382
async def test_tlsCRLFile_support(self):
381383
if not hasattr(ssl, "VERIFY_CRL_CHECK_LEAF") or _ssl.IS_PYOPENSSL:
@@ -531,6 +533,7 @@ def test_wincertstore(self):
531533

532534
@async_client_context.require_auth
533535
@async_client_context.require_tlsCertificateKeyFile
536+
@async_client_context.require_no_api_version
534537
@ignore_deprecations
535538
async def test_mongodb_x509_auth(self):
536539
host, port = await async_client_context.host, await async_client_context.port
@@ -640,6 +643,7 @@ async def test_mongodb_x509_auth(self):
640643
self.fail("Invalid certificate accepted.")
641644

642645
@async_client_context.require_tlsCertificateKeyFile
646+
@async_client_context.require_no_api_version
643647
@ignore_deprecations
644648
async def test_connect_with_ca_bundle(self):
645649
def remove(path):

test/test_ssl.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ def test_simple_ssl(self):
171171
self.assertClientWorks(self.client)
172172

173173
@client_context.require_tlsCertificateKeyFile
174+
@client_context.require_no_api_version
174175
@ignore_deprecations
175176
def test_tlsCertificateKeyFilePassword(self):
176177
# Expects the server to be running with server.pem and ca.pem
@@ -376,6 +377,7 @@ def test_cert_ssl_validation_hostname_matching(self):
376377
)
377378

378379
@client_context.require_tlsCertificateKeyFile
380+
@client_context.require_no_api_version
379381
@ignore_deprecations
380382
def test_tlsCRLFile_support(self):
381383
if not hasattr(ssl, "VERIFY_CRL_CHECK_LEAF") or _ssl.IS_PYOPENSSL:
@@ -531,6 +533,7 @@ def test_wincertstore(self):
531533

532534
@client_context.require_auth
533535
@client_context.require_tlsCertificateKeyFile
536+
@client_context.require_no_api_version
534537
@ignore_deprecations
535538
def test_mongodb_x509_auth(self):
536539
host, port = client_context.host, client_context.port
@@ -640,6 +643,7 @@ def test_mongodb_x509_auth(self):
640643
self.fail("Invalid certificate accepted.")
641644

642645
@client_context.require_tlsCertificateKeyFile
646+
@client_context.require_no_api_version
643647
@ignore_deprecations
644648
def test_connect_with_ca_bundle(self):
645649
def remove(path):

0 commit comments

Comments
 (0)