pytest-api-framework-alpha 0.3.8__tar.gz → 0.3.9__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.8 → pytest_api_framework_alpha-0.3.9}/PKG-INFO +1 -1
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/conftest.py +9 -7
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/utils/lark_util.py +9 -10
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/pytest_api_framework_alpha.egg-info/PKG-INFO +1 -1
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/setup.py +1 -1
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/__init__.py +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/base_class.py +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/db/__init__.py +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/db/mysql_db.py +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/db/redis_db.py +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/exceptions.py +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/exit_code.py +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/extract.py +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/global_attribute.py +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/http_client.py +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/render_data.py +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/report.py +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/script.py +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/startapp.py +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/utils/__init__.py +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/utils/common.py +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/utils/date_util.py +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/utils/encrypt.py +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/utils/log_util.py +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/utils/mock_util.py +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/utils/yaml_util.py +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/validate.py +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/pytest_api_framework_alpha.egg-info/SOURCES.txt +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/pytest_api_framework_alpha.egg-info/dependency_links.txt +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/pytest_api_framework_alpha.egg-info/requires.txt +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/pytest_api_framework_alpha.egg-info/top_level.txt +0 -0
- {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/setup.cfg +0 -0
|
@@ -3,6 +3,7 @@ import re
|
|
|
3
3
|
import sys
|
|
4
4
|
import copy
|
|
5
5
|
import time
|
|
6
|
+
import platform
|
|
6
7
|
import threading
|
|
7
8
|
import importlib
|
|
8
9
|
import traceback
|
|
@@ -523,13 +524,14 @@ def pytest_terminal_summary(terminalreporter, exitstatus, config):
|
|
|
523
524
|
terminalreporter.write(f"跳过用例数: {skipped}\n", yellow=True, bold=True)
|
|
524
525
|
terminalreporter.write(f"用例通过率: {pass_rate}%\n", green=True, bold=True)
|
|
525
526
|
terminalreporter.write("====================================\n", blue=True, bold=True)
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
527
|
+
if "linux" in platform.platform().lower():
|
|
528
|
+
LarkUtil(settings.LARK_WEBHOOK).send_test_report(
|
|
529
|
+
total=total,
|
|
530
|
+
passed=passed,
|
|
531
|
+
failed=failed,
|
|
532
|
+
skipped=skipped,
|
|
533
|
+
report_url=os.environ.get("ALLURE_REPORT_URL")
|
|
534
|
+
)
|
|
533
535
|
|
|
534
536
|
|
|
535
537
|
def pytest_exception_interact(node, call, report):
|
{pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/utils/lark_util.py
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import requests
|
|
2
2
|
import json
|
|
3
|
-
|
|
3
|
+
from datetime import datetime
|
|
4
4
|
|
|
5
5
|
class LarkUtil:
|
|
6
6
|
def __init__(self, webhook: str):
|
|
@@ -44,17 +44,16 @@ class LarkUtil:
|
|
|
44
44
|
pass_rate = round(passed / (total - skipped) * 100, 2)
|
|
45
45
|
except ZeroDivisionError:
|
|
46
46
|
pass_rate = 0
|
|
47
|
-
markdown = f"""
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
**用例通过率:** {pass_rate}%
|
|
47
|
+
markdown = f"""**执行结果统计:**
|
|
48
|
+
**执行用例总数:** {total}
|
|
49
|
+
**通过用例数:** {passed}
|
|
50
|
+
**失败用例数:** {failed}
|
|
51
|
+
**跳过用例数:** {skipped}
|
|
52
|
+
**用例通过率:** {pass_rate}%
|
|
54
53
|
"""
|
|
55
54
|
if report_url:
|
|
56
|
-
markdown += f"\n
|
|
57
|
-
return self.send_markdown("自动化测试结果", markdown)
|
|
55
|
+
markdown += f"\n**测试报告:** 👉 [点击查看测试报告]({report_url})"
|
|
56
|
+
return self.send_markdown(f"自动化测试结果 {datetime.now().strftime("%Y-%m-%d %X")}", markdown)
|
|
58
57
|
|
|
59
58
|
|
|
60
59
|
if __name__ == "__main__":
|
|
File without changes
|
{pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/base_class.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/db/__init__.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/db/mysql_db.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/db/redis_db.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/exceptions.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/exit_code.py
RENAMED
|
File without changes
|
|
File without changes
|
{pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/global_attribute.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/http_client.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/render_data.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/utils/__init__.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/utils/common.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/utils/date_util.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/utils/encrypt.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/utils/log_util.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/utils/mock_util.py
RENAMED
|
File without changes
|
{pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/utils/yaml_util.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|