@@ -132,7 +132,7 @@ class AsyncClientUnitTest(AsyncUnitTest):
132
132
133
133
async def asyncSetUp (self ) -> None :
134
134
self .client = await self .async_rs_or_single_client (
135
- connect = True , serverSelectionTimeoutMS = 100
135
+ connect = False , serverSelectionTimeoutMS = 100
136
136
)
137
137
138
138
@pytest .fixture (autouse = True )
@@ -258,7 +258,7 @@ async def test_get_default_database(self):
258
258
c = await self .async_rs_or_single_client (
259
259
"mongodb://%s:%d/foo"
260
260
% (await async_client_context .host , await async_client_context .port ),
261
- connect = True ,
261
+ connect = False ,
262
262
)
263
263
self .assertEqual (AsyncDatabase (c , "foo" ), c .get_default_database ())
264
264
# Test that default doesn't override the URI value.
@@ -274,7 +274,7 @@ async def test_get_default_database(self):
274
274
275
275
c = await self .async_rs_or_single_client (
276
276
"mongodb://%s:%d/" % (await async_client_context .host , await async_client_context .port ),
277
- connect = True ,
277
+ connect = False ,
278
278
)
279
279
self .assertEqual (AsyncDatabase (c , "foo" ), c .get_default_database ("foo" ))
280
280
@@ -292,14 +292,14 @@ async def test_get_default_database_with_authsource(self):
292
292
await async_client_context .host ,
293
293
await async_client_context .port ,
294
294
)
295
- c = await self .async_rs_or_single_client (uri , connect = True )
295
+ c = await self .async_rs_or_single_client (uri , connect = False )
296
296
self .assertEqual (AsyncDatabase (c , "foo" ), c .get_default_database ())
297
297
298
298
async def test_get_database_default (self ):
299
299
c = await self .async_rs_or_single_client (
300
300
"mongodb://%s:%d/foo"
301
301
% (await async_client_context .host , await async_client_context .port ),
302
- connect = True ,
302
+ connect = False ,
303
303
)
304
304
self .assertEqual (AsyncDatabase (c , "foo" ), c .get_database ())
305
305
@@ -317,7 +317,7 @@ async def test_get_database_default_with_authsource(self):
317
317
await async_client_context .host ,
318
318
await async_client_context .port ,
319
319
)
320
- c = await self .async_rs_or_single_client (uri , connect = True )
320
+ c = await self .async_rs_or_single_client (uri , connect = False )
321
321
self .assertEqual (AsyncDatabase (c , "foo" ), c .get_database ())
322
322
323
323
async def test_primary_read_pref_with_tags (self ):
@@ -817,7 +817,7 @@ async def test_init_disconnected(self):
817
817
self .assertIsInstance (await c .is_primary , bool )
818
818
c = await self .async_rs_or_single_client (connect = False )
819
819
self .assertIsInstance (await c .is_mongos , bool )
820
- c = await self .async_rs_or_single_client (connect = True )
820
+ c = await self .async_rs_or_single_client (connect = False )
821
821
self .assertIsInstance (c .options .pool_options .max_pool_size , int )
822
822
self .assertIsInstance (c .nodes , frozenset )
823
823
@@ -850,12 +850,12 @@ async def test_init_disconnected_with_auth(self):
850
850
851
851
async def test_equality (self ):
852
852
seed = "{}:{}" .format (* list (self .client ._topology_settings .seeds )[0 ])
853
- c = await self .async_rs_or_single_client (seed , connect = True )
853
+ c = await self .async_rs_or_single_client (seed , connect = False )
854
854
self .assertEqual (async_client_context .client , c )
855
855
# Explicitly test inequality
856
856
self .assertFalse (async_client_context .client != c )
857
857
858
- c = await self .async_rs_or_single_client ("invalid.com" , connect = True )
858
+ c = await self .async_rs_or_single_client ("invalid.com" , connect = False )
859
859
self .assertNotEqual (async_client_context .client , c )
860
860
self .assertTrue (async_client_context .client != c )
861
861
@@ -877,9 +877,9 @@ async def test_equality(self):
877
877
878
878
async def test_hashable (self ):
879
879
seed = "{}:{}" .format (* list (self .client ._topology_settings .seeds )[0 ])
880
- c = await self .async_rs_or_single_client (seed , connect = True )
880
+ c = await self .async_rs_or_single_client (seed , connect = False )
881
881
self .assertIn (c , {async_client_context .client })
882
- c = await self .async_rs_or_single_client ("invalid.com" , connect = True )
882
+ c = await self .async_rs_or_single_client ("invalid.com" , connect = False )
883
883
self .assertNotIn (c , {async_client_context .client })
884
884
885
885
async def test_host_w_port (self ):
@@ -1618,7 +1618,7 @@ def init(self, *args):
1618
1618
finally :
1619
1619
ServerHeartbeatStartedEvent .__init__ = old_init # type: ignore
1620
1620
1621
- async def test_small_heartbeat_frequency_ms (self ):
1621
+ def test_small_heartbeat_frequency_ms (self ):
1622
1622
uri = "mongodb://example/?heartbeatFrequencyMS=499"
1623
1623
with self .assertRaises (ConfigurationError ) as context :
1624
1624
AsyncMongoClient (uri )
0 commit comments