From 0302d713e0f4012861da16aba024768e4f7a97ff Mon Sep 17 00:00:00 2001 From: qiaoxinjiu Date: Sat, 9 May 2026 16:03:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=A4=9A=E4=B8=AAstory?= =?UTF-8?q?=E5=8F=82=E6=95=B0=EF=BC=88=E7=94=A8=E9=80=97=E5=8F=B7=E5=88=86?= =?UTF-8?q?=E9=9A=94=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zhyy/test_case/run_tests.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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()