pytest-api-framework-alpha 0.3.11__tar.gz → 0.3.13__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/PKG-INFO +1 -1
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/conftest.py +5 -5
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/db/mysql_db.py +11 -5
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/pytest_api_framework_alpha.egg-info/PKG-INFO +1 -1
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/setup.py +1 -1
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/__init__.py +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/base_class.py +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/db/__init__.py +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/db/redis_db.py +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/exceptions.py +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/exit_code.py +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/extract.py +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/global_attribute.py +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/http_client.py +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/render_data.py +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/report.py +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/script.py +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/startapp.py +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/utils/__init__.py +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/utils/common.py +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/utils/date_util.py +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/utils/encrypt.py +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/utils/lark_util.py +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/utils/log_util.py +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/utils/mock_util.py +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/utils/yaml_util.py +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/validate.py +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/pytest_api_framework_alpha.egg-info/SOURCES.txt +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/pytest_api_framework_alpha.egg-info/dependency_links.txt +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/pytest_api_framework_alpha.egg-info/requires.txt +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/pytest_api_framework_alpha.egg-info/top_level.txt +0 -0
- {pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/setup.cfg +0 -0
{pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/conftest.py
RENAMED
|
@@ -279,9 +279,10 @@ def pytest_generate_tests(metafunc):
|
|
|
279
279
|
|
|
280
280
|
|
|
281
281
|
def pytest_collection_modifyitems(items):
|
|
282
|
+
# 过滤掉不在收集范围的case
|
|
283
|
+
items = [item for item in items if getattr(item, "callspec", None)]
|
|
282
284
|
# 重新排序
|
|
283
285
|
new_items = sort(items)
|
|
284
|
-
# Demo: new_items = [items[0],items[2],items[1],items[3]]
|
|
285
286
|
items[:] = new_items
|
|
286
287
|
for item in items:
|
|
287
288
|
# 获取mark标记
|
|
@@ -292,6 +293,8 @@ def pytest_collection_modifyitems(items):
|
|
|
292
293
|
item.add_marker(mark)
|
|
293
294
|
|
|
294
295
|
|
|
296
|
+
|
|
297
|
+
|
|
295
298
|
def pytest_collection_finish(session):
|
|
296
299
|
"""获取最终排序后的 items 列表"""
|
|
297
300
|
logger.info(f"共收集到 {len(session.items)} 个测试用例")
|
|
@@ -526,7 +529,7 @@ def pytest_terminal_summary(terminalreporter, exitstatus, config):
|
|
|
526
529
|
if settings.ONLY_LINUX_NOTIFICATION:
|
|
527
530
|
if "linux" not in platform.platform().lower():
|
|
528
531
|
return
|
|
529
|
-
for webhook in settings.LARK_WEBHOOKS:
|
|
532
|
+
for webhook in settings.LARK_WEBHOOKS.get(CONTEXT.get("env")):
|
|
530
533
|
LarkUtil(webhook).send_test_report(
|
|
531
534
|
total=total,
|
|
532
535
|
passed=passed,
|
|
@@ -537,7 +540,6 @@ def pytest_terminal_summary(terminalreporter, exitstatus, config):
|
|
|
537
540
|
env=CONTEXT.get("env")
|
|
538
541
|
)
|
|
539
542
|
|
|
540
|
-
|
|
541
543
|
def pytest_exception_interact(node, call, report):
|
|
542
544
|
"""
|
|
543
545
|
用例执行抛出异常时,将异常记录到日志
|
|
@@ -801,11 +803,9 @@ def sort(case_items):
|
|
|
801
803
|
# 生成每个组当前的索引
|
|
802
804
|
ori_name_temp = None
|
|
803
805
|
ori_name_list = []
|
|
804
|
-
|
|
805
806
|
for item in non_custom_scope_items:
|
|
806
807
|
clase_id = item.cls.__name__
|
|
807
808
|
original_name = item.originalname
|
|
808
|
-
|
|
809
809
|
if ori_name_temp is None or ori_name_temp == original_name:
|
|
810
810
|
ori_name_temp = original_name
|
|
811
811
|
case_suite_num += 1
|
{pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/db/mysql_db.py
RENAMED
|
@@ -139,8 +139,14 @@ class MysqlDB:
|
|
|
139
139
|
|
|
140
140
|
@staticmethod
|
|
141
141
|
def custom_serializer(obj):
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
142
|
+
try:
|
|
143
|
+
if isinstance(obj, datetime):
|
|
144
|
+
return obj.strftime('%Y-%m-%d %H:%M:%S')
|
|
145
|
+
elif isinstance(obj, Decimal):
|
|
146
|
+
return float(obj)
|
|
147
|
+
elif isinstance(obj, bytes):
|
|
148
|
+
return obj.decode(errors='ignore', encoding='utf-8')
|
|
149
|
+
# 不处理的类型:直接返回原对象
|
|
150
|
+
return obj
|
|
151
|
+
except Exception:
|
|
152
|
+
return obj
|
{pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/__init__.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/base_class.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/db/__init__.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/db/redis_db.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/exceptions.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/exit_code.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/extract.py
RENAMED
|
File without changes
|
|
File without changes
|
{pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/http_client.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/render_data.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/startapp.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/utils/__init__.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/utils/common.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/utils/date_util.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/utils/encrypt.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/utils/lark_util.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/utils/log_util.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/utils/mock_util.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/utils/yaml_util.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.11 → pytest_api_framework_alpha-0.3.13}/framework/validate.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|