1.tox是openstack中的测试工具(另一个是run_test.sh脚本) 2.用途是检查软件包能否在不同的python版本中或解释器中正常安装 3.这个工具是在一个虚拟环境中测试的 4.使用方法 tox -e pep8 #对代码进行检查 tox -e py27 #测试环境 [tox] minversion = 2.0 envlist = py34,py27,functional,pep8,pip-missing-reqs #python 版本 skipsdist = True [testenv] usedevelop = True # tox is silly... these need to be separated by a newline.... whitelist_externals = bash find rm install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} setenv = VIRTUAL_ENV={envdir} OS_TEST_PATH=./nova/tests/unit LANGUAGE=en_US LC_ALL=en_US.utf-8 deps = -r{toxinidir}/test-requirements.txt commands = find . -type f -name "*.pyc" -delete bash tools/pretty_tox.sh '{posargs}' passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY # there is also secret magic in pretty_tox.sh which lets you run in a fail only # mode. To do this define the TRACE_FAILONLY environmental variable. [testenv:pep8] basepython = python2.7 deps = hacking commands = bash tools/flake8wrap.sh {posargs}
openstack中的tox.ini文件
最新推荐文章于 2024-07-07 20:00:37 发布
本文介绍了OpenStack中的tox.ini文件,它作为一个测试工具,用于确保软件包能在不同Python版本中正常运行。tox在虚拟环境中执行测试,包括pep8代码检查、Python版本测试等。通过指定的命令如`tox -e pep8`和`tox -e py27`,可以执行不同的测试任务,确保代码质量与兼容性。
摘要由CSDN通过智能技术生成