File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 2121from pymongo .command_cursor import CommandCursor
2222from pymongo .errors import NotMasterError , OperationFailure
2323from test import unittest , IntegrationTest , client_context
24+ from test .utils import single_client
2425
2526
2627class EventListener (monitoring .Subscriber ):
@@ -298,7 +299,10 @@ def test_get_more_failure(self):
298299 @client_context .require_replica_set
299300 def test_not_master_error (self ):
300301 address = next (iter (self .client .secondaries ))
301- client = MongoClient (* address )
302+ client = single_client (* address )
303+ # Clear authentication command results from the listener.
304+ client .admin .command ('ismaster' )
305+ self .listener .results = {}
302306 error = None
303307 try :
304308 client .pymongo_test .test .find_one_and_delete ({})
You can’t perform that action at this time.
0 commit comments