py.test: error: unrecognized arguments: --cov=ner_brands --cov-report=term-missing --cov-config

后端 未结 6 2153
囚心锁ツ
囚心锁ツ 2021-02-06 20:20

when I am trying to run my test through command line

py.test  file_name.py

I got this error:

py.test: error: unrecognized argum         


        
6条回答
  •  有刺的猬
    2021-02-06 20:37

    For those who use CentOS 6, the version of setuptools is old and you need to upgrade it also:

    pip install pytest-cov
    pip install --upgrade setuptools
    

    Just after installing pip install pytest-cov:

    ~ # py.test --version
    This is pytest version 3.0.5, imported from /usr/lib/python2.6/site-packages/pytest.pyc
    
    ~ # pip install --upgrade setuptools
    [...]
    Successfully installed setuptools-30.3.0
    
    ~ # py.test --version
    This is pytest version 3.0.5, imported from /usr/lib/python2.6/site-packages/pytest.pyc
    setuptools registered plugins:
      pytest-cov-2.4.0 at /usr/lib/python2.6/site-packages/pytest_cov/plugin.py
    

提交回复
热议问题