@@ -141,8 +141,10 @@ def _get_region():
141
141
def _read_test_config_file (filename ):
142
142
"""Reads test inclusion or exclusion file and returns the contents"""
143
143
tests_integ_dir = Path (__file__ ).resolve ().parents [1 ]
144
- test_config_file_path = str (Path (tests_integ_dir , "config" , filename ))
145
- test_config = load_yaml (test_config_file_path )
144
+ test_config_file_path = Path (tests_integ_dir , "config" , filename )
145
+ if not test_config_file_path .is_file ():
146
+ return {}
147
+ test_config = load_yaml (str (test_config_file_path ))
146
148
return test_config
147
149
148
150
@@ -164,7 +166,7 @@ def current_region_does_not_support(services):
164
166
region = _get_region ()
165
167
region_exclude_services = _read_test_config_file ("region_service_exclusion.yaml" )
166
168
167
- if region not in region_exclude_services [ "regions" ] :
169
+ if region not in region_exclude_services . get ( "regions" , {}) :
168
170
return False
169
171
170
172
# check if any one of the services is in the excluded services for current testing region
@@ -179,7 +181,7 @@ def current_region_not_included(services):
179
181
region = _get_region ()
180
182
region_include_services = _read_test_config_file ("region_service_inclusion.yaml" )
181
183
182
- if region not in region_include_services [ "regions" ] :
184
+ if region not in region_include_services . get ( "regions" , {}) :
183
185
return True
184
186
185
187
# check if any one of the services is in the excluded services for current testing region
0 commit comments