【发布时间】:2019-07-19 07:05:57
【问题描述】:
我正在阅读并尝试了解一些在线图书馆,我遇到了以下情况:
- 没有 pytest 或 unitest 的测试
我在网上阅读,发现一个 tox.ini 文件,如下所示:
[tox]
envlist =
py27
py35
py36
py37
flake8
[testenv:flake8]
basepython = python
deps = flake8
commands = flake8 related
[testenv]
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/related
deps =
-r{toxinidir}/dev-requirements.txt
commands =
pip install -U pip
py.test --basetemp={envtmpdir}
我仍然无法让它运行。我做了以下事情:
pip install -U pip
py.test --basetemp={envtmpdir}
py.tests --basetemp={py37}
usage: py.test [options] [file_or_dir] [file_or_dir] [...]
py.test: error: unrecognized arguments: --mccabe --pep8 --flake8
inifile: /home/tmhdev/Documents/related/pytest.ini
rootdir: /home/tmhdev/Documents/related
如何运行此文件中的测试? 库调用相关:https://github.com/genomoncology/related/tree/master/tests
【问题讨论】:
-
那些未知选项在您的
pytest.ini中。删除它们,这些是flake8的选项,而不是pytest。
标签: python pytest python-unittest python-3.7 tox