| 123456789101112131415161718 |
- import logging
- from pathlib import Path
- class Config(object):
- log_level = logging.DEBUG
- log_format = '%(asctime)s - %(name)s - %(levelname)s - %(filename)s:%(lineno)d - %(message)s'
- # 基础路径配置
- BASE_DIR = Path(__file__).resolve().parent.parent
- # 测试相关配置
- TESTS_DIR = BASE_DIR / "Tests"
- ALLURE_RESULTS_DIR = BASE_DIR / "Reports" / "allure-results"
- ALLURE_REPORT_DIR = BASE_DIR / "Reports" / "allure-report"
- REPORT_ARCHIVE_DIR = BASE_DIR / "Reports" / "archives"
- # 确保目录存在
- for directory in [ALLURE_RESULTS_DIR, ALLURE_REPORT_DIR, REPORT_ARCHIVE_DIR]:
- directory.mkdir(parents=True, exist_ok=True)
|