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.
Files changed (32) hide show
  1. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/PKG-INFO +1 -1
  2. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/conftest.py +9 -7
  3. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/utils/lark_util.py +9 -10
  4. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/pytest_api_framework_alpha.egg-info/PKG-INFO +1 -1
  5. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/setup.py +1 -1
  6. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/__init__.py +0 -0
  7. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/base_class.py +0 -0
  8. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/db/__init__.py +0 -0
  9. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/db/mysql_db.py +0 -0
  10. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/db/redis_db.py +0 -0
  11. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/exceptions.py +0 -0
  12. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/exit_code.py +0 -0
  13. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/extract.py +0 -0
  14. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/global_attribute.py +0 -0
  15. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/http_client.py +0 -0
  16. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/render_data.py +0 -0
  17. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/report.py +0 -0
  18. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/script.py +0 -0
  19. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/startapp.py +0 -0
  20. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/utils/__init__.py +0 -0
  21. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/utils/common.py +0 -0
  22. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/utils/date_util.py +0 -0
  23. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/utils/encrypt.py +0 -0
  24. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/utils/log_util.py +0 -0
  25. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/utils/mock_util.py +0 -0
  26. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/utils/yaml_util.py +0 -0
  27. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/framework/validate.py +0 -0
  28. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/pytest_api_framework_alpha.egg-info/SOURCES.txt +0 -0
  29. {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
  30. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/pytest_api_framework_alpha.egg-info/requires.txt +0 -0
  31. {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
  32. {pytest_api_framework_alpha-0.3.8 → pytest_api_framework_alpha-0.3.9}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-api-framework-alpha
3
- Version: 0.3.8
3
+ Version: 0.3.9
4
4
  Author: alpha
5
5
  Author-email:
6
6
  Requires-Python: >=3.6
@@ -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
- LarkUtil(settings.LARK_WEBHOOK).send_test_report(
527
- total=total,
528
- passed=passed,
529
- failed=failed,
530
- skipped=skipped,
531
- report_url=os.environ.get("ALLURE_REPORT_URL")
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):
@@ -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
- **执行用例总数:** {total}
50
- **通过用例数:** {passed}
51
- **失败用例数:** {failed}
52
- **跳过用例数:** {skipped}
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\t**测试报告:** 👉 [点击查看测试报告]({report_url})"
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__":
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-api-framework-alpha
3
- Version: 0.3.8
3
+ Version: 0.3.9
4
4
  Author: alpha
5
5
  Author-email:
6
6
  Requires-Python: >=3.6
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="pytest-api-framework-alpha", # 包名(必须唯一)
5
- version="0.3.8",
5
+ version="0.3.9",
6
6
  packages=find_packages(),
7
7
  author="alpha",
8
8
  author_email="",