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

后端 未结 6 2159
囚心锁ツ
囚心锁ツ 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:45

    If the other answers here didn't work for you, you may have py.test installed somewhere else in your system. In my case, I ran into the issue described here inside a virtual environment, but it turned out that pytest was defaulting to my system installation (which did not have pytest-cov installed).

    Deactivate your virtual environment or start a new shell and run the following to confirm:

    pip3 freeze | grep pytest
    

    (or pip freeze | grep pytest if you're running python2)

    If you find it, try uninstalling it, then reactivate your virtual environment and try again.

提交回复
热议问题