【发布时间】:2017-12-04 22:05:30
【问题描述】:
我正在为我的项目使用 tox。
这是我的tox.ini 文件:
[tox]
envlist =
py27,
lint,
coverage
skipsdist = True
[testenv:py27]
deps = -rrequirements.txt
commands = python -m unittest discover -s ./tests
[testenv:coverage]
commands =
coverage run --source=tests -m unittest discover -s tests/
coverage html
coverage report
[testenv:lint]
commands = pylint ./foo
每当我运行 tox 时,一切都会被执行,基本上是 linting,覆盖。
但 Tox 对所有内容都显示警告。
WARNING:test command found but not installed in testenv
Maybe you forgot to specify a dependency? See also the whitelist_externals envconfig setting.
一切都成功了,但它仍然显示警告和错误。谁能告诉我我做错了什么?
我的requirements.txt 文件是这样的:
requests==2.18.4
JsonForm==0.0.2
jsonify==0.5
jsonschema==2.6.0
JsonSir==0.0.2
python-dateutil==1.5
DateTime==4.2
urllib3==1.22
contextlib2==0.5.5
mock==2.0.0
patch==1.16
【问题讨论】:
-
如果您在需求中配置 pylint 和覆盖率,您会得到同样的错误吗?
-
刚刚检查过,是的,它显示了相同的错误,但我得到了我想要的输出,但我无法理解为什么两者都有警告
标签: python unit-testing pylint tox