diff --git a/zhyy/test_case/run_tests.py b/zhyy/test_case/run_tests.py index af54c52..2b3feac 100644 --- a/zhyy/test_case/run_tests.py +++ b/zhyy/test_case/run_tests.py @@ -145,7 +145,13 @@ def run_tests(target, test_type='all', **kwargs): if not test_files: print("错误: 未找到测试文件") return 1 - args = test_files + [f'--allure-stories={target}'] + base_args + if ',' in target: + stories = [s.strip() for s in target.split(',')] + print(f"多个story标签: {stories}") + story_args = [f'--allure-stories={s}' for s in stories] + args = test_files + story_args + base_args + else: + args = test_files + [f'--allure-stories={target}'] + base_args elif test_type == 'marker': print(f"按pytest标记运行: {target}") test_files = get_all_test_files()