@@ -264,38 +264,47 @@ def test_logging_when_overriden_admin_and_user_configs_are_found(get_data_dir, c
264264 del os .environ ["SAGEMAKER_USER_CONFIG_OVERRIDE" ]
265265 logger .propagate = False
266266
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+ ):
268271 logger .propagate = True
269272 caplog .set_level (logging .DEBUG , logger = logger .name )
270273 os .environ ["SAGEMAKER_ADMIN_CONFIG_OVERRIDE" ] = get_data_dir
271274 load_sagemaker_config ()
272275 assert "Fetched defaults config from location: {}" .format (get_data_dir ) in caplog .text
273276 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+ )
276284 in caplog .text
277285 )
278- assert "Unable to load the config file from the location: {}" .format (
279- _DEFAULT_USER_CONFIG_FILE_PATH
280- ) in caplog .text
281286 del os .environ ["SAGEMAKER_ADMIN_CONFIG_OVERRIDE" ]
282287 logger .propagate = False
283288
284289
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+ ):
286293 logger .propagate = True
287294 caplog .set_level (logging .DEBUG , logger = logger .name )
288295 os .environ ["SAGEMAKER_USER_CONFIG_OVERRIDE" ] = get_data_dir
289296 load_sagemaker_config ()
290297 assert "Fetched defaults config from location: {}" .format (get_data_dir ) in caplog .text
291298 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+ )
294306 in caplog .text
295307 )
296- assert "Unable to load the config file from the location: {}" .format (
297- _DEFAULT_ADMIN_CONFIG_FILE_PATH
298- ) in caplog .text
299308 del os .environ ["SAGEMAKER_USER_CONFIG_OVERRIDE" ]
300309 logger .propagate = False
301310
@@ -314,8 +323,18 @@ def test_logging_when_default_admin_and_default_user_config_not_found(caplog):
314323 "Not applying SDK defaults from location: {}" .format (_DEFAULT_USER_CONFIG_FILE_PATH )
315324 in caplog .text
316325 )
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+ )
319338 logger .propagate = False
320339
321340
0 commit comments