@@ -94,7 +94,6 @@ def run_tests(reg, site, flg, all_tests):
94
94
flg (list[str]): The list of pytest flags to be used.
95
95
all_tests (list[str]): The list of test file paths to execute.
96
96
"""
97
- all_tests = remove_skipped_tests (all_tests , site , reg )
98
97
try :
99
98
if len (all_tests ) > 0 :
100
99
logging .info (f"Tests for { reg } region on { site } page." )
@@ -134,59 +133,6 @@ def get_region_tests(test_region: str) -> list[str]:
134
133
)
135
134
136
135
137
- def remove_skipped_tests (extracted_tests , live_site , reg ):
138
- """
139
- Reads the mapping for the given region and site and removes any tests that are marked as skipped.
140
-
141
- Args:
142
- extracted_tests (list[str]): The list of test file paths to execute.
143
- live_site (str): Page being tested.
144
- reg (str): The test region identifier.
145
- Returns:
146
- list[str]: A list of test file paths for the given region.
147
- """
148
- mid_path = f"/{ reg } /" if live_site != "demo" else "/"
149
- live_sites = [
150
- (f"{ live_site } { mid_path } { live_site } _{ suffix } " , f"_{ suffix } _" )
151
- for suffix in ("ad" , "cc" )
152
- ]
153
- for live_site , suffix in live_sites :
154
- skipped_tests = get_skipped_tests (live_site )
155
- if skipped_tests and skipped_tests != "All" :
156
- skipped_tests = list (
157
- map (
158
- lambda test : os .path .join (current_dir , "Unified" , test ),
159
- skipped_tests ,
160
- )
161
- )
162
-
163
- def should_keep_test (test ):
164
- return (
165
- suffix not in test
166
- if skipped_tests == "All"
167
- else test not in skipped_tests
168
- )
169
-
170
- extracted_tests = list (filter (should_keep_test , extracted_tests ))
171
- return extracted_tests
172
-
173
-
174
- def get_skipped_tests (live_site ) -> list [str ] | str :
175
- """
176
- Read the mapping for the given region and site and return any tests that are marked as skipped.
177
-
178
- Arg:
179
- live_site (str): The site is being tested.
180
- Returns:
181
- list[str] | str: A list of tests that should be skipped, or "All" if all tests should be skipped.
182
- """
183
- with open (current_dir + "/constants/" + live_site + ".json" , "r" ) as fp :
184
- live_site_data = load (fp )
185
- if live_site_data .get ("skip" ):
186
- return "All"
187
- return live_site_data .get ("skipped" , [])
188
-
189
-
190
136
def get_flags_and_sanitize (flags_arguments : list [str ]) -> list [str ]:
191
137
"""
192
138
Extract and validate pytest flags from command-line arguments.
@@ -204,7 +150,7 @@ def get_flags_and_sanitize(flags_arguments: list[str]) -> list[str]:
204
150
# add workers and rerun flaky failed tests.
205
151
flg = []
206
152
expanded_args = [
207
- flag .split () if "--" not in flag else [flag ] for flag in flags_arguments
153
+ flag .split () if " " in flag else [flag ] for flag in flags_arguments
208
154
]
209
155
flags_arguments [:] = sum (expanded_args , [])
210
156
for arg in flags_arguments [:]:
0 commit comments