[Python-modules-commits] [tox] 48/69: Various fixes to get some semblance of the test suite passing at
Barry Warsaw
barry at moszumanska.debian.org
Fri Sep 5 23:26:29 UTC 2014
This is an automated email from the git hooks/post-receive script.
barry pushed a commit to branch master
in repository tox.
commit 572b40983a7c6c40e89d18480bf5a52fd78f6ead
Author: Barry Warsaw <barry at debian.org>
Date: Sat Jun 21 18:44:45 2014 -0400
Various fixes to get some semblance of the test suite passing at
package build time. This isn't perfect because tox's tests depend on tox
being built and installed - a catch 22. However, we can do a lot and there
are DEP-8 tests to handle the rest of it.
Forwarded: not-needed
Patch-Name: build-time-tests.patch
---
tests/test_config.py | 1 +
tests/test_z_cmdline.py | 31 +++++++++++++++++++++++++++++--
tox.ini | 2 +-
3 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/tests/test_config.py b/tests/test_config.py
index bc5a683..52572dd 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -1160,6 +1160,7 @@ class TestParseEnv:
config = newconfig([], inisource)
assert config.envconfigs['hello'].recreate
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
class TestCmdInvocation:
def test_help(self, cmd):
result = cmd.run("tox", "-h")
diff --git a/tests/test_z_cmdline.py b/tests/test_z_cmdline.py
index 283c993..30a7838 100644
--- a/tests/test_z_cmdline.py
+++ b/tests/test_z_cmdline.py
@@ -1,3 +1,4 @@
+import os
import tox
import py
import pytest
@@ -177,6 +178,7 @@ def XXX_test_package(cmd, initproj):
"*created sdist package at*",
])
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
def test_minversion(cmd, initproj):
initproj("interp123-0.5", filedefs={
'tests': {'test_hello.py': "def test_hello(): pass"},
@@ -191,6 +193,7 @@ def test_minversion(cmd, initproj):
])
assert result.ret
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
def test_run_custom_install_command_error(cmd, initproj):
initproj("interp123-0.5", filedefs={
'tox.ini': '''
@@ -204,6 +207,7 @@ def test_run_custom_install_command_error(cmd, initproj):
])
assert result.ret
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
def test_unknown_interpreter_and_env(cmd, initproj):
initproj("interp123-0.5", filedefs={
'tests': {'test_hello.py': "def test_hello(): pass"},
@@ -226,6 +230,7 @@ def test_unknown_interpreter_and_env(cmd, initproj):
"*ERROR*unknown*",
])
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
def test_unknown_interpreter(cmd, initproj):
initproj("interp123-0.5", filedefs={
'tests': {'test_hello.py': "def test_hello(): pass"},
@@ -242,6 +247,7 @@ def test_unknown_interpreter(cmd, initproj):
"*ERROR*InterpreterNotFound*xyz_unknown_interpreter*",
])
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
def test_skip_unknown_interpreter(cmd, initproj):
initproj("interp123-0.5", filedefs={
'tests': {'test_hello.py': "def test_hello(): pass"},
@@ -258,6 +264,7 @@ def test_skip_unknown_interpreter(cmd, initproj):
"*SKIPPED*InterpreterNotFound*xyz_unknown_interpreter*",
])
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
def test_unknown_dep(cmd, initproj):
initproj("dep123-0.7", filedefs={
'tests': {'test_hello.py': "def test_hello(): pass"},
@@ -273,6 +280,7 @@ def test_unknown_dep(cmd, initproj):
"*ERROR*could not install*qweqwe123*",
])
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
def test_unknown_environment(cmd, initproj):
initproj("env123-0.7", filedefs={
'tox.ini': ''
@@ -283,6 +291,7 @@ def test_unknown_environment(cmd, initproj):
"*ERROR*unknown*environment*qpwoei*",
])
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
def test_skip_sdist(cmd, initproj):
initproj("pkg123-0.7", filedefs={
'tests': {'test_hello.py': "def test_hello(): pass"},
@@ -300,6 +309,7 @@ def test_skip_sdist(cmd, initproj):
result = cmd.run("tox", )
assert result.ret == 0
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
def test_minimal_setup_py_empty(cmd, initproj):
initproj("pkg123-0.7", filedefs={
'tests': {'test_hello.py': "def test_hello(): pass"},
@@ -315,6 +325,7 @@ def test_minimal_setup_py_empty(cmd, initproj):
"*ERROR*empty*",
])
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
def test_minimal_setup_py_comment_only(cmd, initproj):
initproj("pkg123-0.7", filedefs={
'tests': {'test_hello.py': "def test_hello(): pass"},
@@ -331,6 +342,7 @@ def test_minimal_setup_py_comment_only(cmd, initproj):
"*ERROR*empty*",
])
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
def test_minimal_setup_py_non_functional(cmd, initproj):
initproj("pkg123-0.7", filedefs={
'tests': {'test_hello.py': "def test_hello(): pass"},
@@ -348,6 +360,7 @@ def test_minimal_setup_py_non_functional(cmd, initproj):
"*ERROR*check setup.py*",
])
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
def test_sdist_fails(cmd, initproj):
initproj("pkg123-0.7", filedefs={
'tests': {'test_hello.py': "def test_hello(): pass"},
@@ -363,6 +376,7 @@ def test_sdist_fails(cmd, initproj):
"*FAIL*could not package project*",
])
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
def test_package_install_fails(cmd, initproj):
initproj("pkg123-0.7", filedefs={
'tests': {'test_hello.py': "def test_hello(): pass"},
@@ -389,6 +403,7 @@ def test_package_install_fails(cmd, initproj):
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
class TestToxRun:
@pytest.fixture
def example123(self, initproj):
@@ -403,7 +418,7 @@ class TestToxRun:
changedir=tests
commands= py.test --basetemp={envtmpdir} \
--junitxml=junit-{envname}.xml
- deps=pytest
+ sitepackages=True
'''
})
@@ -450,6 +465,7 @@ class TestToxRun:
])
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
def test_develop(initproj, cmd):
initproj("example123", filedefs={'tox.ini': """
"""})
@@ -457,6 +473,7 @@ def test_develop(initproj, cmd):
assert not result.ret
assert "sdist-make" not in result.stdout.str()
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
def test_usedevelop(initproj, cmd):
initproj("example123", filedefs={'tox.ini': """
[testenv]
@@ -466,6 +483,7 @@ def test_usedevelop(initproj, cmd):
assert not result.ret
assert "sdist-make" not in result.stdout.str()
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
def test_usedevelop_mixed(initproj, cmd):
initproj("example123", filedefs={'tox.ini': """
[testenv:devenv]
@@ -484,6 +502,7 @@ def test_usedevelop_mixed(initproj, cmd):
assert not result.ret
assert "sdist-make" in result.stdout.str()
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
def test_test_usedevelop(cmd, initproj):
initproj("example123-0.5", filedefs={
'tests': {'test_hello.py': """
@@ -497,7 +516,7 @@ def test_test_usedevelop(cmd, initproj):
changedir=tests
commands=
py.test --basetemp={envtmpdir} --junitxml=junit-{envname}.xml []
- deps=pytest
+ sitepackages=True
'''
})
result = cmd.run("tox", "-v")
@@ -537,6 +556,7 @@ def test_test_usedevelop(cmd, initproj):
])
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
def test_test_piphelp(initproj, cmd):
initproj("example123", filedefs={'tox.ini': """
# content of: tox.ini
@@ -550,6 +570,7 @@ def test_test_piphelp(initproj, cmd):
result = cmd.run("tox")
assert not result.ret
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
def test_notest(initproj, cmd):
initproj("example123", filedefs={'tox.ini': """
# content of: tox.ini
@@ -568,6 +589,7 @@ def test_notest(initproj, cmd):
"*py26*reusing*",
])
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
def test_PYC(initproj, cmd, monkeypatch):
initproj("example123", filedefs={'tox.ini': ''})
monkeypatch.setenv("PYTHONDOWNWRITEBYTECODE", 1)
@@ -577,6 +599,7 @@ def test_PYC(initproj, cmd, monkeypatch):
"*create*",
])
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
def test_env_VIRTUALENV_PYTHON(initproj, cmd, monkeypatch):
initproj("example123", filedefs={'tox.ini': ''})
monkeypatch.setenv("VIRTUALENV_PYTHON", '/FOO')
@@ -586,6 +609,7 @@ def test_env_VIRTUALENV_PYTHON(initproj, cmd, monkeypatch):
"*create*",
])
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
def test_sdistonly(initproj, cmd):
initproj("example123", filedefs={'tox.ini': """
"""})
@@ -596,6 +620,7 @@ def test_sdistonly(initproj, cmd):
])
assert "-mvirtualenv" not in result.stdout.str()
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
def test_separate_sdist_no_sdistfile(cmd, initproj):
distshare = cmd.tmpdir.join("distshare")
initproj("pkg123-0.7", filedefs={
@@ -611,6 +636,7 @@ def test_separate_sdist_no_sdistfile(cmd, initproj):
sdistfile = l[0]
assert 'pkg123-0.7.zip' in str(sdistfile)
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
def test_separate_sdist(cmd, initproj):
distshare = cmd.tmpdir.join("distshare")
initproj("pkg123-0.7", filedefs={
@@ -652,6 +678,7 @@ def test_installpkg(tmpdir, newconfig):
sdist_path = session.sdist()
assert sdist_path == p
+ at pytest.mark.skipif(os.environ.get('DEB_SKIP_TOX_TESTS'), reason='Use DEP-8')
@pytest.mark.xfail("sys.platform == 'win32' and sys.version_info < (2,6)",
reason="test needs better impl")
def test_envsitepackagesdir(cmd, initproj):
diff --git a/tox.ini b/tox.ini
index 6bcca5e..02aa79c 100644
--- a/tox.ini
+++ b/tox.ini
@@ -5,7 +5,7 @@ envlist=py27,py26,py34,py33,py32,pypy,flakes
commands=echo {posargs}
[testenv]
-commands=py.test --junitxml={envlogdir}/junit-{envname}.xml {posargs}
+commands=py.test-3 --junitxml={envlogdir}/junit-{envname}.xml {posargs}
deps=pytest>=2.3.5
[testenv:docs]
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/tox.git
More information about the Python-modules-commits
mailing list