Pārlūkot izejas kodu

修改配置文件

yunwinLiu 7 mēneši atpakaļ
vecāks
revīzija
2519f8a928
3 mainītis faili ar 14 papildinājumiem un 20 dzēšanām
  1. 0 6
      test_case/__init__.py
  2. 7 7
      test_case/qccq/test_allAPI.py
  3. 7 7
      test_case/test_allAPI.py

+ 0 - 6
test_case/__init__.py

@@ -1,6 +0,0 @@
-from pathlib import Path
-
-path = Path(__file__).parent.glob("**/*.yaml")
-
-for i in path:
-    print(type(i))

+ 7 - 7
test_case/qccq/test_allAPI.py

@@ -8,7 +8,8 @@ import pytest
 from common.parameterize import ddt, read_testcase
 from common.request_util import RequestUtil
 
-# path = Path(__file__).parent.glob("**/*.yaml")
+path = Path(__file__).parent.glob("**/*.yaml")
+
 
 def creat_case(yaml_path):
     @pytest.mark.parametrize("arg_names", read_testcase(rf"{yaml_path}"))
@@ -31,11 +32,10 @@ class TestAPI:
 
 
 
-data = [Path(r"test_case/qccq/个人中心/test_001_个人中心-我的消息.yaml")]
-# for yaml_path in path:
-#     data.append(yaml_path)
-# data.sort()
+data = []
+for yaml_path in path:
+    data.append(yaml_path)
+data.sort()
 for yaml_path in data:
     yaml_name = yaml_path.name[:-5]
-    setattr(TestAPI, yaml_name, creat_case(yaml_path))
-
+    setattr(TestAPI, yaml_name, creat_case(yaml_path))

+ 7 - 7
test_case/test_allAPI.py

@@ -8,7 +8,8 @@ import pytest
 from common.parameterize import ddt, read_testcase
 from common.request_util import RequestUtil
 
-# path = Path(__file__).parent.glob("**/*.yaml")
+path = Path(__file__).parent.glob("**/*.yaml")
+
 
 def creat_case(yaml_path):
     @pytest.mark.parametrize("arg_names", read_testcase(rf"{yaml_path}"))
@@ -31,11 +32,10 @@ class TestAPI:
 
 
 
-data = [Path(r"D:\TestPythonProject\TEST\test_case\qccq\个人中心\test_002_个人中心-我的收藏.yaml")]
-# for yaml_path in path:
-#     data.append(yaml_path)
-# data.sort()
+data = []
+for yaml_path in path:
+    data.append(yaml_path)
+data.sort()
 for yaml_path in data:
     yaml_name = yaml_path.name[:-5]
-    setattr(TestAPI, yaml_name, creat_case(yaml_path))
-
+    setattr(TestAPI, yaml_name, creat_case(yaml_path))