错误1
import pytest_html
ModuleNotFoundError: No module named 'pytest_html'
解决:
需设置pycharm 的运行方式为pytest
错误2
ERROR: usage: main.py [options] [file_or_dir] [file_or_dir] [...]
main.py: error: unrecognized arguments: --html=HtmlTestReport/report.html --alluredir=HtmlTestReport/allure
inifile: None
解决:
pip install pytest-html -i https://pypi.tuna.tsinghua.edu.cn/simple/
命令行方式执行:
pytest --html=report.html