Merge "tox: disable proxies when running nosetests"

This commit is contained in:
Jenkins 2015-06-25 15:19:46 +00:00 committed by Gerrit Code Review
commit 0f723a9772
2 changed files with 15 additions and 3 deletions

12
tools/noproxy Normal file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env python
#
# clean http_proxy variables from environment as they make httpretty
# fail, but may be in the environment for reasons such as pip install
import os
import sys
for k in ('http_proxy', 'https_proxy', 'HTTP_PROXY', 'HTTPS_PROXY'):
if k in os.environ:
del os.environ[k]
os.execvpe(sys.argv[1], sys.argv[1:], os.environ)

View File

@ -13,13 +13,13 @@ setenv = VIRTUAL_ENV={envdir}
LC_ALL = en_US.utf-8
deps = -r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
commands = nosetests {posargs}
commands = {envpython} {toxinidir}/tools/noproxy nosetests {posargs}
[testenv:py27-coverage]
commands = nosetests --with-coverage --cover-erase --cover-package=cloudinit --cover-min-percentage=90 --cover-html {posargs}
commands = {envpython} {toxinidir}/tools/noproxy nosetests --with-coverage --cover-erase --cover-package=cloudinit --cover-min-percentage=90 --cover-html {posargs}
[testenv:py34-coverage]
commands = nosetests --with-coverage --cover-erase --cover-package=cloudinit --cover-min-percentage=90 --cover-html {posargs}
commands = {envpython} {toxinidir}/tools/noproxy nosetests --with-coverage --cover-erase --cover-package=cloudinit --cover-min-percentage=90 --cover-html {posargs}
[testenv:pep8]
commands = flake8 {posargs}