| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #!/usr/bin/env python3
- """
- Swagger 模块 3(人员)真实联调 — 使用 backend/.env 的 QIWEI_GUID。
- 用法(先 pnpm dev):
- cd backend/tests_python
- python run_section_3_live.py
- """
- from __future__ import annotations
- import subprocess
- import sys
- from pathlib import Path
- from load_env import load_backend_env
- ROOT = Path(__file__).resolve().parent
- def main() -> int:
- env = load_backend_env()
- print("=" * 60)
- print("Swagger 模块 3(人员)真实联调")
- print("=" * 60)
- print(f" QIWEI_TOKEN: {'已配置' if env.get('QIWEI_TOKEN') else '未配置'}")
- print(f" QIWEI_GUID: {env.get('QIWEI_GUID', '未配置')}")
- print("=" * 60)
- if not env.get("QIWEI_GUID", "").strip():
- print("请在 backend/.env 配置 QIWEI_GUID")
- return 1
- cmd = [
- sys.executable,
- "-m",
- "pytest",
- "test_03_module_live.py",
- "-v",
- "--html=report_section_3.html",
- "--self-contained-html",
- ]
- rc = subprocess.run(cmd, cwd=ROOT).returncode
- print()
- report = ROOT / "report_section_3.html"
- print(f"{'全部通过' if rc == 0 else '存在失败'}。报告: {report}")
- return rc
- if __name__ == "__main__":
- raise SystemExit(main())
|