Tox WARNING:test 命令找到但未安装在 testenv 中 [英] Tox WARNING:test command found but not installed in testenv

查看:58
本文介绍了Tox WARNING:test 命令找到但未安装在 testenv 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目中使用了 tox.

I am using tox for my project.

这是我的 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、coverage.

whenever I run tox, everything is getting executed which basically is linting, coverage.

但 Tox 对所有内容都显示警告.

but Tox is displaying warning for everything.

WARNING:test command found but not installed in testenv
Maybe you forgot to specify a dependency? See also the whitelist_externals envconfig setting.

一切都成功了,但它仍然显示警告和错误.谁能告诉我我做错了什么?

Everything succeeds, but it is still displaying warning and errors. Can anyone tell me to what I am doing wrong?

我的 requirements.txt 文件是这样的:

My requirements.txt file is this:

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

推荐答案

您在 commands 中使用的程序必须安装在 tox 的虚拟环境中或列入白名单:

Programs that you use in commands must either be installed in tox' virtual environment or whitelisted:

[tox]
envlist =
    py27,
    lint,
    coverage

skipsdist = True

[testenv:py27]
deps = -rrequirements.txt
whitelist_externals = python
commands = python -m unittest discover -s ./tests

[testenv:coverage]
whitelist_externals = coverage
commands =
    coverage run --source=tests -m unittest discover -s tests/
    coverage html
    coverage report


[testenv:lint]
whitelist_externals = pylint
commands = pylint ./foo

这篇关于Tox WARNING:test 命令找到但未安装在 testenv 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆