@@ -264,38 +264,47 @@ def test_logging_when_overriden_admin_and_user_configs_are_found(get_data_dir, c
264
264
del os .environ ["SAGEMAKER_USER_CONFIG_OVERRIDE" ]
265
265
logger .propagate = False
266
266
267
- def test_logging_when_overriden_admin_is_found_and_default_user_config_not_found (get_data_dir , caplog ):
267
+
268
+ def test_logging_when_overriden_admin_is_found_and_default_user_config_not_found (
269
+ get_data_dir , caplog
270
+ ):
268
271
logger .propagate = True
269
272
caplog .set_level (logging .DEBUG , logger = logger .name )
270
273
os .environ ["SAGEMAKER_ADMIN_CONFIG_OVERRIDE" ] = get_data_dir
271
274
load_sagemaker_config ()
272
275
assert "Fetched defaults config from location: {}" .format (get_data_dir ) in caplog .text
273
276
assert (
274
- "Not applying SDK defaults from location: {}" .format (
275
- _DEFAULT_USER_CONFIG_FILE_PATH )
277
+ "Not applying SDK defaults from location: {}" .format (_DEFAULT_USER_CONFIG_FILE_PATH )
278
+ in caplog .text
279
+ )
280
+ assert (
281
+ "Unable to load the config file from the location: {}" .format (
282
+ _DEFAULT_USER_CONFIG_FILE_PATH
283
+ )
276
284
in caplog .text
277
285
)
278
- assert "Unable to load the config file from the location: {}" .format (
279
- _DEFAULT_USER_CONFIG_FILE_PATH
280
- ) in caplog .text
281
286
del os .environ ["SAGEMAKER_ADMIN_CONFIG_OVERRIDE" ]
282
287
logger .propagate = False
283
288
284
289
285
- def test_logging_when_default_admin_not_found_and_overriden_user_config_is_found (get_data_dir , caplog ):
290
+ def test_logging_when_default_admin_not_found_and_overriden_user_config_is_found (
291
+ get_data_dir , caplog
292
+ ):
286
293
logger .propagate = True
287
294
caplog .set_level (logging .DEBUG , logger = logger .name )
288
295
os .environ ["SAGEMAKER_USER_CONFIG_OVERRIDE" ] = get_data_dir
289
296
load_sagemaker_config ()
290
297
assert "Fetched defaults config from location: {}" .format (get_data_dir ) in caplog .text
291
298
assert (
292
- "Not applying SDK defaults from location: {}" .format (
293
- _DEFAULT_ADMIN_CONFIG_FILE_PATH )
299
+ "Not applying SDK defaults from location: {}" .format (_DEFAULT_ADMIN_CONFIG_FILE_PATH )
300
+ in caplog .text
301
+ )
302
+ assert (
303
+ "Unable to load the config file from the location: {}" .format (
304
+ _DEFAULT_ADMIN_CONFIG_FILE_PATH
305
+ )
294
306
in caplog .text
295
307
)
296
- assert "Unable to load the config file from the location: {}" .format (
297
- _DEFAULT_ADMIN_CONFIG_FILE_PATH
298
- ) in caplog .text
299
308
del os .environ ["SAGEMAKER_USER_CONFIG_OVERRIDE" ]
300
309
logger .propagate = False
301
310
@@ -314,8 +323,18 @@ def test_logging_when_default_admin_and_default_user_config_not_found(caplog):
314
323
"Not applying SDK defaults from location: {}" .format (_DEFAULT_USER_CONFIG_FILE_PATH )
315
324
in caplog .text
316
325
)
317
- assert "Unable to load the config file from the location: {}" .format (_DEFAULT_ADMIN_CONFIG_FILE_PATH ) in caplog .text
318
- assert "Unable to load the config file from the location: {}" .format (_DEFAULT_USER_CONFIG_FILE_PATH ) in caplog .text
326
+ assert (
327
+ "Unable to load the config file from the location: {}" .format (
328
+ _DEFAULT_ADMIN_CONFIG_FILE_PATH
329
+ )
330
+ in caplog .text
331
+ )
332
+ assert (
333
+ "Unable to load the config file from the location: {}" .format (
334
+ _DEFAULT_USER_CONFIG_FILE_PATH
335
+ )
336
+ in caplog .text
337
+ )
319
338
logger .propagate = False
320
339
321
340
0 commit comments