Skip to content

Commit a0693d9

Browse files
committed
connect to db
1 parent 67c8a85 commit a0693d9

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

test/asynchronous/test_dns.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ async def run_test(self):
143143
copts["tlsAllowInvalidHostnames"] = True
144144

145145
client = AsyncPyMongoTestCase.unmanaged_simple_client(uri, **copts)
146+
if client._options.connect:
147+
await client.aconnect()
146148
if num_seeds is not None:
147149
self.assertEqual(len(client._topology_settings.seeds), num_seeds)
148150
if hosts is not None:

test/test_dns.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,14 @@ def run_test(self):
143143
copts["tlsAllowInvalidHostnames"] = True
144144

145145
client = PyMongoTestCase.unmanaged_simple_client(uri, **copts)
146+
if client._options.connect:
147+
client._connect()
146148
if num_seeds is not None:
147149
self.assertEqual(len(client._topology_settings.seeds), num_seeds)
148150
if hosts is not None:
149-
wait_until(lambda: hosts == client.nodes, "match test hosts to client nodes")
151+
wait_until(
152+
lambda: hosts == client.nodes, "match test hosts to client nodes"
153+
)
150154
if num_hosts is not None:
151155
wait_until(
152156
lambda: num_hosts == len(client.nodes), "wait to connect to num_hosts"

0 commit comments

Comments
 (0)