PYTHON-2928 Fix mod_wsgi test failures (#750)

This commit is contained in:
Julius Park 2021-10-06 11:56:44 -07:00 committed by GitHub
parent 6e7b652d86
commit dd9206a1ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,19 +29,13 @@ from pymongo.hello import HelloCompat
from pymongo.mongo_client import MongoClient
client = MongoClient()
# If the deployment is a replica set, connect to the whole set.
replica_set_name = client.admin.command(HelloCompat.LEGACY_CMD).get('setName')
if replica_set_name:
client = MongoClient(replicaSet=replica_set_name)
collection = client.test.test
ndocs = 20
collection.drop()
collection.insert_many([{'i': i} for i in range(ndocs)])
client.close() # Discard main thread's request socket.
client.close() # Discard main thread's request socket.
client = MongoClient()
collection = client.test.test
try:
from mod_wsgi import version as mod_wsgi_version