pytest框架兼容unittest,而pytest生成報告可以通過命令完成
https://www.cnblogs.com/feiyi211/p/6626277.html
同樣適用於unittest
1、生成junitxml格式
pytest --junitxml report.xml test.py
pytest -v test.py --junitxml report.xml
pytest test.py --junitxml=/user/log/report.xml
2、生成log文件
pytest -v test_one_func.py --resultlog=report\log.txt
3、生成html文件
pip install pytest-html
pytest -v test_one_func.py --html=report\test_one_func.html