Skip to content

Commit 3068911

Browse files
committed
PYTHON-525 Fix read preferences tests for mongos.
1 parent eb117f3 commit 3068911

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/test_read_preferences.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
IntegrationTest,
4242
db_user,
4343
db_pwd)
44+
from test.utils import connected
4445
from test.version import Version
4546

4647

@@ -551,8 +552,8 @@ def test_mongos_connection(self):
551552
None, [{}]
552553
):
553554
# Create a client e.g. with read_preference=NEAREST
554-
c = get_client(host, port,
555-
read_preference=mode(tag_sets=tag_sets))
555+
c = connected(get_client(
556+
host, port, read_preference=mode(tag_sets=tag_sets)))
556557

557558
self.assertEqual(is_mongos, c.is_mongos)
558559
cursor = c.pymongo_test.test.find()
@@ -591,8 +592,8 @@ def test_mongos_connection(self):
591592
[{'dc': 'la'}, {'dc': 'sf'}],
592593
[{'dc': 'la'}, {'dc': 'sf'}, {}],
593594
):
594-
c = get_client(host, port,
595-
read_preference=mode(tag_sets=tag_sets))
595+
c = connected(get_client(
596+
host, port, read_preference=mode(tag_sets=tag_sets)))
596597

597598
self.assertEqual(is_mongos, c.is_mongos)
598599
cursor = c.pymongo_test.test.find()

0 commit comments

Comments
 (0)