Files
lib_rgb/testcases/main.py

24 lines
988 B
Python

import os
import pytest
from pawpaw_ci_test_framework.operate_log import OperateLog
if __name__ == "__main__":
# 获取当前脚本文件所在的目录路径
current_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))).replace('\\', '/')
reports_path = os.path.join(current_path, 'reports')
allure_path = os.path.join(current_path, 'reports', 'allure')
test_result_path = os.path.join(current_path, 'reports', 'test_result')
if not os.path.exists(reports_path):
os.makedirs(reports_path)
if not os.path.exists(allure_path):
os.makedirs(allure_path)
if not os.path.exists(test_result_path):
os.makedirs(test_result_path)
#每次执行全部用例之前删除logs下的日志文件
OperateLog().delete_logs()
# 执行测试用例
pytest.main(['-q', "--alluredir", allure_path, '--clean-alluredir'])
#合并生成的日志文件
OperateLog().merge_logs('lib_rgb_test.log')