File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -156,11 +156,24 @@ def select_by_testcase(items):
156156 plan = json .load (plan_file )
157157 planned_tests = plan .get ("tests" , [])
158158
159- return filter (lambda item : any (
160- [str (planed_item .get ("id" )) in [str (allure_id ) for allure_id in allure_label (item , LabelType .ID )]
161- or
162- (planed_item .get ("selector" ) == allure_full_name (item ))
163- for planed_item in planned_tests ]), items ) if planned_tests else items
159+ if planned_tests :
160+
161+ def is_planed (item ):
162+ allure_ids = allure_label (item , LabelType .ID )
163+ allure_string_ids = list (map (str , allure_ids ))
164+ for planed_item in planned_tests :
165+ planed_item_string_id = str (planed_item .get ("id" ))
166+ planed_item_selector = planed_item .get ("selector" )
167+ if (
168+ planed_item_string_id in allure_string_ids
169+ or planed_item_selector == allure_full_name (item )
170+ ):
171+ return True
172+ return False
173+
174+ return [item for item in items if is_planed (item )]
175+ else :
176+ return items
164177
165178
166179def pytest_collection_modifyitems (items , config ):
You can’t perform that action at this time.
0 commit comments