优化生成测试结果统计文件的方法
This commit is contained in:
parent
9823a3249d
commit
d6a50429f4
|
@ -2,12 +2,13 @@
|
|||
/venv/
|
||||
.idea/
|
||||
__*__/
|
||||
/Temp/*
|
||||
/outFiles/report/*
|
||||
/outFiles/logs/*
|
||||
/outFiles/screenShot/*
|
||||
/outFiles/pytest_result/*
|
||||
/outFiles/pytest_report/*
|
||||
/Temp/
|
||||
/outFiles/
|
||||
/outFiles/report/
|
||||
/outFiles/logs/
|
||||
/outFiles/screenShot/
|
||||
/outFiles/pytest_result/
|
||||
/outFiles/pytest_report/
|
||||
/.pytest_cache/
|
||||
|
||||
.DS_Store
|
||||
|
|
|
@ -132,7 +132,10 @@ def pytest_runtest_makereport(item, call): # description取值为用例说明__
|
|||
|
||||
def pytest_terminal_summary(terminalreporter, exitstatus, config):
|
||||
"""收集测试结果展示在控制台,并发送到企业微信"""
|
||||
with open(BASE_DIR + '/outFiles/pytest_result/pytest_result.json', 'r', encoding='utf-8') as f:
|
||||
result_dir = BASE_DIR + '/outFiles/pytest_result'
|
||||
if not os.path.exists(result_dir):
|
||||
os.makedirs(result_dir, exist_ok=True)
|
||||
with open(result_dir + '/pytest_result.json', 'r', encoding='utf-8') as f:
|
||||
pytest_result = json.loads(f.read())
|
||||
total_case = pytest_result['case_count']
|
||||
pass_case = pytest_result["case_pass"]
|
||||
|
|
Loading…
Reference in New Issue