@@ -53,7 +53,6 @@ def __init__(
53
53
self .old_dns_resolver_response = None
54
54
55
55
def enable (self ):
56
- print ("enable" )
57
56
self .old_min_srv_rescan_interval = common .MIN_SRV_RESCAN_INTERVAL
58
57
self .old_dns_resolver_response = (
59
58
pymongo .asynchronous .srv_resolver ._SrvResolver .get_hosts_and_min_ttl
@@ -83,7 +82,6 @@ def __enter__(self):
83
82
self .enable ()
84
83
85
84
def disable (self ):
86
- print ("disable" )
87
85
common .MIN_SRV_RESCAN_INTERVAL = self .old_min_srv_rescan_interval # type: ignore
88
86
pymongo .asynchronous .srv_resolver ._SrvResolver .get_hosts_and_min_ttl = ( # type: ignore
89
87
self .old_dns_resolver_response
@@ -186,6 +184,9 @@ def dns_resolver_response():
186
184
):
187
185
await assertion_method (expected_response , client )
188
186
187
+ # Close the client early to avoid affecting the next scenario run.
188
+ client .close ()
189
+
189
190
async def test_addition (self ):
190
191
response = self .BASE_SRV_RESPONSE [:]
191
192
response .append (("localhost.test.build.10gen.cc" , 27019 ))
@@ -219,11 +220,7 @@ async def test_dns_failures(self):
219
220
for exc in (exception .FormError , exception .Timeout , exception .TooBig ):
220
221
221
222
def response_callback (* args ):
222
- # raise exc("DNS Failure!")
223
- return []
224
-
225
- print (exc )
226
- # await asyncio.sleep(0.5)
223
+ raise exc ("DNS Failure!" )
227
224
228
225
await self .run_scenario (response_callback , False )
229
226
0 commit comments