We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 001e62b commit 9b7d774Copy full SHA for 9b7d774
tests/test_connection.py
@@ -610,7 +610,10 @@ def test_connect_with_replicaset_via_kwargs(self):
610
connection kwargs
611
"""
612
c = connect(replicaset="local-rs")
613
- assert c._MongoClient__options.replica_set_name == "local-rs"
+ if hasattr(c, "_MongoClient__options"):
614
+ assert c._MongoClient__options.replica_set_name == "local-rs"
615
+ else: # pymongo >= 4.9
616
+ assert c._options.replica_set_name == "local-rs"
617
db = get_db()
618
assert isinstance(db, pymongo.database.Database)
619
assert db.name == "test"
0 commit comments