路径兼容windows运行方式

This commit is contained in:
wangjie 2023-08-03 17:56:47 +08:00
parent 2ab2ea9232
commit 34d51b5a68
2 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@
### 技术栈python+pytest+requests+allure+pytest-html
- 选择语言python>=3.8
- 选择语言python>=3.10
- 编程工具选型pycharm
- 测试框架选型pytest
- 报告可视化方案选型allure、pytest-html

View File

@ -66,7 +66,7 @@ class Logger:
# os.path.join(os.path.dirname(os.path.abspath(__file__)), '../outFiles/logs'))
file_path = LOGS_DIR
dir_name = time.strftime('%Y-%m-%d')
file_name = time.strftime('%Y-%m-%d %H:%M:%S') + '-' + 'log.log'
file_name = time.strftime('%Y-%m-%d_%H-%M-%S') + '-' + 'log.log'
if not os.path.exists(os.path.join(file_path, dir_name)):
os.makedirs(os.path.join(file_path, dir_name))
cls._log_path = os.path.join(file_path, dir_name, file_name)