File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change 1313
1414import datetime
1515
16+ import logging
17+
1618from smexperiments import trial
1719from smexperiments .search_expression import SearchExpression , Filter , Operator
1820from tests .helpers import retry
@@ -109,15 +111,24 @@ def test_search(sagemaker_boto_client):
109111
110112def test_add_remove_trial_component (trial_obj , trial_component_obj ):
111113 trial_obj .add_trial_component (trial_component_obj )
114+ logging .info (f"Added trial component { trial_component_obj .trial_component_name } to trial { trial_obj .trial_name } " )
112115
113- def validate ():
116+ def validate_add ():
114117 trial_components = list (trial_obj .list_trial_components ())
115- assert 1 == len (trial_components )
116- trial_obj .remove_trial_component (trial_component_obj )
118+ assert 1 == len (trial_components ), "Expected trial component to be included in trials list of TC"
119+
120+ retry (validate_add )
121+
122+ trial_obj .remove_trial_component (trial_component_obj )
123+ logging .info (
124+ f"Removed trial component { trial_component_obj .trial_component_name } from trial { trial_obj .trial_name } "
125+ )
126+
127+ def validate_remove ():
117128 trial_components = list (trial_obj .list_trial_components ())
118- assert 0 == len (trial_components )
129+ assert 0 == len (trial_components ), "Expected trial component to be removed from trials list of TC"
119130
120- retry (validate , num_attempts = 4 )
131+ retry (validate_remove )
121132
122133
123134def test_save (trial_obj , sagemaker_boto_client ):
You can’t perform that action at this time.
0 commit comments