Skip to content

Commit 9b7d774

Browse files
committed
port test fix from pymongo 4.9 (lost in conflict reso)
1 parent 001e62b commit 9b7d774

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/test_connection.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,10 @@ def test_connect_with_replicaset_via_kwargs(self):
610610
connection kwargs
611611
"""
612612
c = connect(replicaset="local-rs")
613-
assert c._MongoClient__options.replica_set_name == "local-rs"
613+
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"
614617
db = get_db()
615618
assert isinstance(db, pymongo.database.Database)
616619
assert db.name == "test"

0 commit comments

Comments
 (0)