py.test: error: unrecognized arguments: --cov=ner_brands --cov-report=term-missing --cov-config
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: when I am trying to run my test through command line py.test file_name.py I got this error: py.test: error: unrecognized arguments: --cov=ner_brands --cov-report=term-missing --cov-config How can I fix this? 回答1: pytest-cov package is required if you want to pass --cov arguments to pytest, by default it should not be passed though. Are you using a modified version of py.test? pip install pytest-cov would fix your issue. 回答2: For those who use CentOS 6, the version of setuptools is old and you need to upgrade it also: pip install pytest-cov