3232from sagemaker .experiments .trial_component import _TrialComponent
3333from sagemaker .sklearn import SKLearn
3434from sagemaker .utils import retry_with_backoff , unique_name_from_base
35- from tests .integ .sagemaker .experiments .helpers import name , cleanup_exp_resources , clear_run_context
35+ from tests .integ .sagemaker .experiments .helpers import name , cleanup_exp_resources
3636from sagemaker .experiments .run import (
3737 RUN_NAME_BASE ,
3838 DELIMITER ,
@@ -55,7 +55,7 @@ def artifact_file_path(tempdir):
5555metric_name = "Test-Local-Init-Log-Metric"
5656
5757
58- def test_local_run_with_load (sagemaker_session , artifact_file_path , clear_run_context ):
58+ def test_local_run_with_load (sagemaker_session , artifact_file_path ):
5959 exp_name = f"My-Local-Exp-{ name ()} "
6060 with cleanup_exp_resources (exp_names = [exp_name ], sagemaker_session = sagemaker_session ):
6161 # Run name is not provided, will create a new TC
@@ -86,9 +86,7 @@ def verify_load_run():
8686 retry_with_backoff (verify_load_run , 4 )
8787
8888
89- def test_two_local_run_init_with_same_run_name_and_different_exp_names (
90- sagemaker_session , clear_run_context
91- ):
89+ def test_two_local_run_init_with_same_run_name_and_different_exp_names (sagemaker_session ):
9290 exp_name1 = f"my-two-local-exp1-{ name ()} "
9391 exp_name2 = f"my-two-local-exp2-{ name ()} "
9492 run_name = "test-run"
@@ -126,9 +124,7 @@ def test_two_local_run_init_with_same_run_name_and_different_exp_names(
126124 ("my-test4" , "test-run" , "run-display-name-test" ), # with supplied display name
127125 ],
128126)
129- def test_run_name_vs_trial_component_name_edge_cases (
130- sagemaker_session , input_names , clear_run_context
131- ):
127+ def test_run_name_vs_trial_component_name_edge_cases (sagemaker_session , input_names ):
132128 exp_name , run_name , run_display_name = input_names
133129 with cleanup_exp_resources (exp_names = [exp_name ], sagemaker_session = sagemaker_session ):
134130 with Run (
@@ -181,7 +177,6 @@ def test_run_from_local_and_train_job_and_all_exp_cfg_match(
181177 execution_role ,
182178 sagemaker_client_config ,
183179 sagemaker_metrics_config ,
184- clear_run_context ,
185180):
186181 # Notes:
187182 # 1. The 1st Run created locally and its exp config was auto passed to the job
@@ -282,7 +277,6 @@ def test_run_from_local_and_train_job_and_exp_cfg_not_match(
282277 execution_role ,
283278 sagemaker_client_config ,
284279 sagemaker_metrics_config ,
285- clear_run_context ,
286280):
287281 # Notes:
288282 # 1. The 1st Run created locally and its exp config was auto passed to the job
@@ -369,7 +363,6 @@ def test_run_from_train_job_only(
369363 execution_role ,
370364 sagemaker_client_config ,
371365 sagemaker_metrics_config ,
372- clear_run_context ,
373366):
374367 # Notes:
375368 # 1. No Run created locally or specified in experiment config
@@ -420,7 +413,6 @@ def test_run_from_processing_job_and_override_default_exp_config(
420413 execution_role ,
421414 sagemaker_client_config ,
422415 sagemaker_metrics_config ,
423- clear_run_context ,
424416):
425417 # Notes:
426418 # 1. The 1st Run (run) created locally
@@ -500,7 +492,6 @@ def test_run_from_transform_job(
500492 execution_role ,
501493 sagemaker_client_config ,
502494 sagemaker_metrics_config ,
503- clear_run_context ,
504495):
505496 # Notes:
506497 # 1. The 1st Run (run) created locally
@@ -582,7 +573,6 @@ def test_load_run_auto_pass_in_exp_config_to_job(
582573 execution_role ,
583574 sagemaker_client_config ,
584575 sagemaker_metrics_config ,
585- clear_run_context ,
586576):
587577 # Notes:
588578 # 1. In local side, load the Run created previously and invoke a job under the load context
@@ -631,7 +621,7 @@ def test_load_run_auto_pass_in_exp_config_to_job(
631621 )
632622
633623
634- def test_list (run_obj , sagemaker_session , clear_run_context ):
624+ def test_list (run_obj , sagemaker_session ):
635625 tc1 = _TrialComponent .create (
636626 trial_component_name = f"non-run-tc1-{ name ()} " ,
637627 sagemaker_session = sagemaker_session ,
@@ -653,7 +643,7 @@ def test_list(run_obj, sagemaker_session, clear_run_context):
653643 assert run_tcs [0 ].experiment_config == run_obj .experiment_config
654644
655645
656- def test_list_twice (run_obj , sagemaker_session , clear_run_context ):
646+ def test_list_twice (run_obj , sagemaker_session ):
657647 tc1 = _TrialComponent .create (
658648 trial_component_name = f"non-run-tc1-{ name ()} " ,
659649 sagemaker_session = sagemaker_session ,
0 commit comments