@@ -240,15 +240,15 @@ def test_mixin_cleanup_random_ports():
240
240
241
241
242
242
param_values = [
243
- (True , True , None ),
244
- (True , False , ValueError ),
245
- (False , True , None ),
246
- (False , False , ValueError ),
243
+ (True , True ),
244
+ (True , False ),
245
+ (False , True ),
246
+ (False , False ),
247
247
]
248
248
249
249
250
- @pytest .mark .parametrize ("file_exists, km_matches, expected_exception " , param_values )
251
- def test_reconcile_connection_info (file_exists , km_matches , expected_exception ):
250
+ @pytest .mark .parametrize ("file_exists, km_matches" , param_values )
251
+ def test_reconcile_connection_info (file_exists , km_matches ):
252
252
253
253
expected_info = sample_info
254
254
mismatched_info = sample_info .copy ()
@@ -272,9 +272,10 @@ def test_reconcile_connection_info(file_exists, km_matches, expected_exception):
272
272
provisioner_info = info
273
273
km .load_connection_info (provisioner_info )
274
274
else :
275
- # Let this be the case where the connection file exists, the KM has no values
276
- # prior to reconciliation, but the provisioner has returned different values
277
- # and a ValueError is expected.
275
+ # Let this be the case where the connection file exists, and the KM has those values
276
+ # that differ from the ones returned by the provisioner. This is the restart-with-
277
+ # changed-ports case (typical for remote provisioners).
278
+ km .load_connection_info (expected_info )
278
279
provisioner_info = mismatched_info
279
280
else : # connection file does not exist
280
281
if km_matches :
@@ -284,20 +285,11 @@ def test_reconcile_connection_info(file_exists, km_matches, expected_exception):
284
285
provisioner_info = expected_info
285
286
else :
286
287
# Let this be the case where the connection file does not exist, yet the KM
287
- # has values that do not match those returned from the provisioner and a
288
- # ValueError is expected .
288
+ # has values that do not match those returned from the provisioner. This case
289
+ # is probably not practical and is equivalent to the True, False case .
289
290
km .load_connection_info (expected_info )
290
291
provisioner_info = mismatched_info
291
292
292
- if expected_exception is None :
293
- km ._reconcile_connection_info (provisioner_info )
294
- km_info = km .get_connection_info ()
295
- assert km ._equal_connections (km_info , provisioner_info )
296
- else :
297
- with pytest .raises (expected_exception ) as ex :
298
- km ._reconcile_connection_info (provisioner_info )
299
- if file_exists :
300
- assert "Connection file already exists" in str (ex .value )
301
- else :
302
- assert "KernelManager's connection information already exists" in str (ex .value )
303
- assert km ._equal_connections (km .get_connection_info (), provisioner_info ) is False
293
+ km ._reconcile_connection_info (provisioner_info )
294
+ km_info = km .get_connection_info ()
295
+ assert km ._equal_connections (km_info , provisioner_info )
0 commit comments