@@ -370,7 +370,7 @@ def test_train(
370370 assert call_args [i ] == v
371371
372372 with open (docker_compose_file , "r" ) as f :
373- config = yaml .load (f )
373+ config = yaml .load (f , Loader = yaml . SafeLoader )
374374 assert len (config ["services" ]) == instance_count
375375 for h in sagemaker_container .hosts :
376376 assert config ["services" ][h ]["image" ] == image
@@ -419,7 +419,7 @@ def test_train_with_hyperparameters_without_job_name(
419419 )
420420
421421 with open (docker_compose_file , "r" ) as f :
422- config = yaml .load (f )
422+ config = yaml .load (f , Loader = yaml . SafeLoader )
423423 for h in sagemaker_container .hosts :
424424 assert (
425425 "TRAINING_JOB_NAME={}" .format (TRAINING_JOB_NAME )
@@ -491,7 +491,7 @@ def test_train_local_code(get_data_source_instance, tmpdir, sagemaker_session):
491491 shared_folder_path = os .path .join (sagemaker_container .container_root , "shared" )
492492
493493 with open (docker_compose_file , "r" ) as f :
494- config = yaml .load (f )
494+ config = yaml .load (f , Loader = yaml . SafeLoader )
495495 assert len (config ["services" ]) == instance_count
496496
497497 for h in sagemaker_container .hosts :
@@ -543,7 +543,7 @@ def test_train_local_intermediate_output(get_data_source_instance, tmpdir, sagem
543543 intermediate_folder_path = os .path .join (output_path , "output/intermediate" )
544544
545545 with open (docker_compose_file , "r" ) as f :
546- config = yaml .load (f )
546+ config = yaml .load (f , Loader = yaml . SafeLoader )
547547 assert len (config ["services" ]) == instance_count
548548 for h in sagemaker_container .hosts :
549549 assert config ["services" ][h ]["image" ] == image
@@ -596,7 +596,7 @@ def test_serve(tmpdir, sagemaker_session):
596596 )
597597
598598 with open (docker_compose_file , "r" ) as f :
599- config = yaml .load (f )
599+ config = yaml .load (f , Loader = yaml . SafeLoader )
600600
601601 for h in sagemaker_container .hosts :
602602 assert config ["services" ][h ]["image" ] == image
@@ -624,7 +624,7 @@ def test_serve_local_code(tmpdir, sagemaker_session):
624624 )
625625
626626 with open (docker_compose_file , "r" ) as f :
627- config = yaml .load (f )
627+ config = yaml .load (f , Loader = yaml . SafeLoader )
628628
629629 for h in sagemaker_container .hosts :
630630 assert config ["services" ][h ]["image" ] == image
@@ -657,7 +657,7 @@ def test_serve_local_code_no_env(tmpdir, sagemaker_session):
657657 )
658658
659659 with open (docker_compose_file , "r" ) as f :
660- config = yaml .load (f )
660+ config = yaml .load (f , Loader = yaml . SafeLoader )
661661
662662 for h in sagemaker_container .hosts :
663663 assert config ["services" ][h ]["image" ] == image
0 commit comments