【发布时间】:2022-01-23 01:59:17
【问题描述】:
我正在尝试测试用 pycharm 编写的 Django REST API 的视图和模型,并为此安装了 pytest。我已经编写了一些测试,当我想启动它们时,我收到了以下错误消息:
ERROR: usage: _jb_pytest_runner.py [options] [file_or_dir] [file_or_dir] [...]
_jb_pytest_runner.py: error: unrecognized arguments: --cov=frontend --cov-report=html
然后我检查了我是否正确安装了 pytest,看来我已经正确安装了。我同时安装了 Python 2.7.16 和 Python 3.9.6,但使用的是 Python 3。这可能是兼容性问题还是其他原因?
我尝试通过终端使用 py.test 和仅在 IDE 本身中启动测试。我不断收到同样的错误消息。
我尝试了以下方法:
py.test: error: unrecognized arguments: --cov=ner_brands --cov-report=term-missing --cov-config
但我似乎遇到了同样的错误。
ERROR: usage: _jb_pytest_runner.py [options] [file_or_dir] [file_or_dir] [...]
_jb_pytest_runner.py: error: unrecognized arguments: --cov=frontend --cov-report=html
有谁知道我该如何解决这个问题?
提前致谢。
【问题讨论】:
-
@KetZoomer 不,可悲的是。
标签: python django rest pytest pytest-django