summaryrefslogtreecommitdiff
path: root/tests/test_z_cmdline.py
diff options
context:
space:
mode:
authorholger krekel <holger@merlinux.eu>2013-08-14 09:59:16 +0200
committerholger krekel <holger@merlinux.eu>2013-08-14 09:59:16 +0200
commit174908b35143583a7ef6117cbc3d25a3c008d665 (patch)
tree25c80bd45e252cb4991c30f47ef58573a4072c78 /tests/test_z_cmdline.py
parenta13d8aa13bbf600d6f64144c330a94249a90f256 (diff)
downloadtox-174908b35143583a7ef6117cbc3d25a3c008d665.tar.gz
ref pull request 65
make tox run its tests against python2.5 as well vendor virtualenv as 'virtualenv.py' instead of 'virtualenv-1.9.1.py' which triggers some weird logic preventing tox to run its tests on itself.
Diffstat (limited to 'tests/test_z_cmdline.py')
-rw-r--r--tests/test_z_cmdline.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/tests/test_z_cmdline.py b/tests/test_z_cmdline.py
index d7f99b6..6d11dc0 100644
--- a/tests/test_z_cmdline.py
+++ b/tests/test_z_cmdline.py
@@ -3,9 +3,18 @@ import py
import pytest
import sys
from tox._pytestplugin import ReportExpectMock
+try:
+ import json
+except ImportError:
+ import simplejson as json
pytest_plugins = "pytester"
+if sys.version_info < (2,6):
+ PIP_INSECURE = "setenv = PIP_INSECURE=1"
+else:
+ PIP_INSECURE = ""
+
from tox._cmdline import Session
from tox._config import parseconfig
@@ -356,6 +365,8 @@ def test_package_install_fails(cmd, initproj):
"*InvocationError*",
])
+
+
class TestToxRun:
@pytest.fixture
def example123(self, initproj):
@@ -368,9 +379,10 @@ class TestToxRun:
'tox.ini': '''
[testenv]
changedir=tests
+ %s
commands= py.test --basetemp={envtmpdir} --junitxml=junit-{envname}.xml
deps=pytest
- '''
+ ''' % PIP_INSECURE
})
def test_toxuone_env(self, cmd, example123):
@@ -407,7 +419,7 @@ class TestToxRun:
jsonpath = cmd.tmpdir.join("res.json")
result = cmd.run("tox", "--result-json", jsonpath)
assert result.ret == 1
- data = py.std.json.load(jsonpath.open("r"))
+ data = json.load(jsonpath.open("r"))
verify_json_report_format(data)
result.stdout.fnmatch_lines([
"*1 failed*",
@@ -461,10 +473,11 @@ def test_test_usedevelop(cmd, initproj):
[testenv]
usedevelop=True
changedir=tests
+ %s
commands=
py.test --basetemp={envtmpdir} --junitxml=junit-{envname}.xml []
deps=pytest
- '''
+ ''' % PIP_INSECURE
})
result = cmd.run("tox", "-v")
assert not result.ret