python–pytest: error: unrecognized arguments: --cov-report=html
- UID
- 1066743
|
python–pytest: error: unrecognized arguments: --cov-report=html
问题
pytest可以输出覆盖率的html报告
使用命令如下:
pytest -vv --cov=./ --cov-report=html
open htmlcov/index.html
有可能遇到报错:
(venv) zhangxiaofans-MacBook-Pro:mgap-mendel joe$ pytest --cov-report=html
usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --cov-report=html
inifile: None
rootdir: /Users/joe/workspace/platform/mgap-mendel/mgap-mendel
原因
缺少pytest cov的包
解决方法
pip3 install pytest-cov |
|
|
|
|
|