forked from pool/python-tox
Accepting request 331792 from home:rhafer:branches:devel:languages:python
Update to 2.1.1 OBS-URL: https://build.opensuse.org/request/show/331792 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-tox?expand=0&rev=23
This commit is contained in:
committed by
Git OBS Bridge
parent
73e9d53eb9
commit
1fba98acab
@@ -1,9 +1,11 @@
|
||||
--- a/tests/test_config.py
|
||||
+++ b/tests/test_config.py
|
||||
@@ -1346,83 +1346,6 @@ class TestParseEnv:
|
||||
config = newconfig([], inisource)
|
||||
Index: tox-2.1.1/tests/test_config.py
|
||||
===================================================================
|
||||
--- tox-2.1.1.orig/tests/test_config.py
|
||||
+++ tox-2.1.1/tests/test_config.py
|
||||
@@ -1575,84 +1575,6 @@ class TestParseEnv:
|
||||
assert config.envconfigs['hello'].recreate
|
||||
|
||||
|
||||
-class TestCmdInvocation:
|
||||
- def test_help(self, cmd):
|
||||
- result = cmd.run("tox", "-h")
|
||||
@@ -71,22 +73,25 @@
|
||||
- result = cmd.run("tox", "--showconfig")
|
||||
- assert result.ret == 0
|
||||
- result.stdout.fnmatch_lines([
|
||||
- r'*deps=*dep1==2.3, dep2*',
|
||||
- r'*deps*dep1==2.3, dep2*',
|
||||
- ])
|
||||
- # override dep1 specific version, and force version for dep2
|
||||
- result = cmd.run("tox", "--showconfig", "--force-dep=dep1",
|
||||
- "--force-dep=dep2==5.0")
|
||||
- assert result.ret == 0
|
||||
- result.stdout.fnmatch_lines([
|
||||
- r'*deps=*dep1, dep2==5.0*',
|
||||
- r'*deps*dep1, dep2==5.0*',
|
||||
- ])
|
||||
-
|
||||
class TestArgumentParser:
|
||||
|
||||
def test_dash_e_single_1(self):
|
||||
--- a/tests/test_z_cmdline.py
|
||||
+++ b/tests/test_z_cmdline.py
|
||||
@@ -1,685 +0,0 @@
|
||||
-
|
||||
@pytest.mark.parametrize("cmdline,envlist", [
|
||||
("-e py26", ['py26']),
|
||||
("-e py26,py33", ['py26', 'py33']),
|
||||
Index: tox-2.1.1/tests/test_z_cmdline.py
|
||||
===================================================================
|
||||
--- tox-2.1.1.orig/tests/test_z_cmdline.py
|
||||
+++ tox-2.1.1/tests/test_z_cmdline.py
|
||||
@@ -1,727 +0,0 @@
|
||||
-import tox
|
||||
-import py
|
||||
-import pytest
|
||||
@@ -98,38 +103,43 @@
|
||||
-
|
||||
-pytest_plugins = "pytester"
|
||||
-
|
||||
-from tox._cmdline import Session
|
||||
-from tox._config import parseconfig
|
||||
-from tox.session import Session
|
||||
-from tox.config import parseconfig
|
||||
-
|
||||
-
|
||||
-def test_report_protocol(newconfig):
|
||||
- config = newconfig([], """
|
||||
- [testenv:mypython]
|
||||
- deps=xy
|
||||
- """)
|
||||
-
|
||||
- class Popen:
|
||||
- def __init__(self, *args, **kwargs):
|
||||
- pass
|
||||
-
|
||||
- def communicate(self):
|
||||
- return "", ""
|
||||
-
|
||||
- def wait(self):
|
||||
- pass
|
||||
-
|
||||
- session = Session(config, popen=Popen,
|
||||
- Report=ReportExpectMock)
|
||||
- Report=ReportExpectMock)
|
||||
- report = session.report
|
||||
- report.expect("using")
|
||||
- venv = session.getvenv("mypython")
|
||||
- venv.update()
|
||||
- report.expect("logpopen")
|
||||
-
|
||||
-
|
||||
-def test__resolve_pkg(tmpdir, mocksession):
|
||||
- distshare = tmpdir.join("distshare")
|
||||
- spec = distshare.join("pkg123-*")
|
||||
- py.test.raises(tox.exception.MissingDirectory,
|
||||
- 'mocksession._resolve_pkg(spec)')
|
||||
- 'mocksession._resolve_pkg(spec)')
|
||||
- distshare.ensure(dir=1)
|
||||
- py.test.raises(tox.exception.MissingDependency,
|
||||
- 'mocksession._resolve_pkg(spec)')
|
||||
- 'mocksession._resolve_pkg(spec)')
|
||||
- distshare.ensure("pkg123-1.3.5.zip")
|
||||
- p = distshare.ensure("pkg123-1.4.5.zip")
|
||||
-
|
||||
@@ -147,6 +157,7 @@
|
||||
- result = mocksession._resolve_pkg(spec)
|
||||
- assert result == p
|
||||
-
|
||||
-
|
||||
-def test__resolve_pkg_doubledash(tmpdir, mocksession):
|
||||
- distshare = tmpdir.join("distshare")
|
||||
- p = distshare.ensure("pkg-mine-1.3.0.zip")
|
||||
@@ -157,7 +168,6 @@
|
||||
- assert res == p
|
||||
-
|
||||
-
|
||||
-
|
||||
-class TestSession:
|
||||
- def test_make_sdist(self, initproj):
|
||||
- initproj("example123-0.5", filedefs={
|
||||
@@ -167,15 +177,15 @@
|
||||
- })
|
||||
- config = parseconfig([])
|
||||
- session = Session(config)
|
||||
- sdist = session.sdist()
|
||||
- sdist = session.get_installpkg_path()
|
||||
- assert sdist.check()
|
||||
- assert sdist.ext == ".zip"
|
||||
- assert sdist == config.distdir.join(sdist.basename)
|
||||
- sdist2 = session.sdist()
|
||||
- sdist2 = session.get_installpkg_path()
|
||||
- assert sdist2 == sdist
|
||||
- sdist.write("hello")
|
||||
- assert sdist.stat().size < 10
|
||||
- sdist_new = Session(config).sdist()
|
||||
- sdist_new = Session(config).get_installpkg_path()
|
||||
- assert sdist_new == sdist
|
||||
- assert sdist_new.stat().size > 10
|
||||
-
|
||||
@@ -190,7 +200,7 @@
|
||||
- })
|
||||
- config = parseconfig([])
|
||||
- session = Session(config)
|
||||
- sdist = session.sdist()
|
||||
- sdist = session.get_installpkg_path()
|
||||
- assert sdist.check()
|
||||
- assert sdist.ext == ".zip"
|
||||
- assert sdist == config.distdir.join(sdist.basename)
|
||||
@@ -205,7 +215,7 @@
|
||||
- action.popen(["echo", ])
|
||||
- match = mocksession.report.getnext("logpopen")
|
||||
- assert match[1].outpath.relto(mocksession.config.logdir)
|
||||
- assert match[1].shell == False
|
||||
- assert match[1].shell is False
|
||||
-
|
||||
- def test_summary_status(self, initproj, capfd):
|
||||
- initproj("logexample123-0.5", filedefs={
|
||||
@@ -266,6 +276,7 @@
|
||||
- "*created sdist package at*",
|
||||
- ])
|
||||
-
|
||||
-
|
||||
-def test_minversion(cmd, initproj):
|
||||
- initproj("interp123-0.5", filedefs={
|
||||
- 'tests': {'test_hello.py': "def test_hello(): pass"},
|
||||
@@ -280,6 +291,7 @@
|
||||
- ])
|
||||
- assert result.ret
|
||||
-
|
||||
-
|
||||
-def test_run_custom_install_command_error(cmd, initproj):
|
||||
- initproj("interp123-0.5", filedefs={
|
||||
- 'tox.ini': '''
|
||||
@@ -293,6 +305,7 @@
|
||||
- ])
|
||||
- assert result.ret
|
||||
-
|
||||
-
|
||||
-def test_unknown_interpreter_and_env(cmd, initproj):
|
||||
- initproj("interp123-0.5", filedefs={
|
||||
- 'tests': {'test_hello.py': "def test_hello(): pass"},
|
||||
@@ -315,6 +328,7 @@
|
||||
- "*ERROR*unknown*",
|
||||
- ])
|
||||
-
|
||||
-
|
||||
-def test_unknown_interpreter(cmd, initproj):
|
||||
- initproj("interp123-0.5", filedefs={
|
||||
- 'tests': {'test_hello.py': "def test_hello(): pass"},
|
||||
@@ -331,6 +345,23 @@
|
||||
- "*ERROR*InterpreterNotFound*xyz_unknown_interpreter*",
|
||||
- ])
|
||||
-
|
||||
-
|
||||
-def test_skip_platform_mismatch(cmd, initproj):
|
||||
- initproj("interp123-0.5", filedefs={
|
||||
- 'tests': {'test_hello.py': "def test_hello(): pass"},
|
||||
- 'tox.ini': '''
|
||||
- [testenv]
|
||||
- changedir=tests
|
||||
- platform=x123
|
||||
- '''
|
||||
- })
|
||||
- result = cmd.run("tox")
|
||||
- assert not result.ret
|
||||
- result.stdout.fnmatch_lines("""
|
||||
- SKIPPED*platform mismatch*
|
||||
- """)
|
||||
-
|
||||
-
|
||||
-def test_skip_unknown_interpreter(cmd, initproj):
|
||||
- initproj("interp123-0.5", filedefs={
|
||||
- 'tests': {'test_hello.py': "def test_hello(): pass"},
|
||||
@@ -347,6 +378,7 @@
|
||||
- "*SKIPPED*InterpreterNotFound*xyz_unknown_interpreter*",
|
||||
- ])
|
||||
-
|
||||
-
|
||||
-def test_unknown_dep(cmd, initproj):
|
||||
- initproj("dep123-0.7", filedefs={
|
||||
- 'tests': {'test_hello.py': "def test_hello(): pass"},
|
||||
@@ -362,6 +394,7 @@
|
||||
- "*ERROR*could not install*qweqwe123*",
|
||||
- ])
|
||||
-
|
||||
-
|
||||
-def test_unknown_environment(cmd, initproj):
|
||||
- initproj("env123-0.7", filedefs={
|
||||
- 'tox.ini': ''
|
||||
@@ -372,13 +405,13 @@
|
||||
- "*ERROR*unknown*environment*qpwoei*",
|
||||
- ])
|
||||
-
|
||||
-
|
||||
-def test_skip_sdist(cmd, initproj):
|
||||
- initproj("pkg123-0.7", filedefs={
|
||||
- 'tests': {'test_hello.py': "def test_hello(): pass"},
|
||||
- 'setup.py': """
|
||||
- syntax error
|
||||
- """
|
||||
- ,
|
||||
- """,
|
||||
- 'tox.ini': '''
|
||||
- [tox]
|
||||
- skipsdist=True
|
||||
@@ -389,12 +422,12 @@
|
||||
- result = cmd.run("tox", )
|
||||
- assert result.ret == 0
|
||||
-
|
||||
-
|
||||
-def test_minimal_setup_py_empty(cmd, initproj):
|
||||
- initproj("pkg123-0.7", filedefs={
|
||||
- 'tests': {'test_hello.py': "def test_hello(): pass"},
|
||||
- 'setup.py': """
|
||||
- """
|
||||
- ,
|
||||
- """,
|
||||
- 'tox.ini': ''
|
||||
-
|
||||
- })
|
||||
@@ -404,13 +437,13 @@
|
||||
- "*ERROR*empty*",
|
||||
- ])
|
||||
-
|
||||
-
|
||||
-def test_minimal_setup_py_comment_only(cmd, initproj):
|
||||
- initproj("pkg123-0.7", filedefs={
|
||||
- 'tests': {'test_hello.py': "def test_hello(): pass"},
|
||||
- 'setup.py': """\n# some comment
|
||||
-
|
||||
- """
|
||||
- ,
|
||||
- """,
|
||||
- 'tox.ini': ''
|
||||
-
|
||||
- })
|
||||
@@ -420,14 +453,14 @@
|
||||
- "*ERROR*empty*",
|
||||
- ])
|
||||
-
|
||||
-
|
||||
-def test_minimal_setup_py_non_functional(cmd, initproj):
|
||||
- initproj("pkg123-0.7", filedefs={
|
||||
- 'tests': {'test_hello.py': "def test_hello(): pass"},
|
||||
- 'setup.py': """
|
||||
- import sys
|
||||
-
|
||||
- """
|
||||
- ,
|
||||
- """,
|
||||
- 'tox.ini': ''
|
||||
-
|
||||
- })
|
||||
@@ -437,13 +470,13 @@
|
||||
- "*ERROR*check setup.py*",
|
||||
- ])
|
||||
-
|
||||
-
|
||||
-def test_sdist_fails(cmd, initproj):
|
||||
- initproj("pkg123-0.7", filedefs={
|
||||
- 'tests': {'test_hello.py': "def test_hello(): pass"},
|
||||
- 'setup.py': """
|
||||
- syntax error
|
||||
- """
|
||||
- ,
|
||||
- """,
|
||||
- 'tox.ini': '',
|
||||
- })
|
||||
- result = cmd.run("tox", )
|
||||
@@ -452,6 +485,7 @@
|
||||
- "*FAIL*could not package project*",
|
||||
- ])
|
||||
-
|
||||
-
|
||||
-def test_package_install_fails(cmd, initproj):
|
||||
- initproj("pkg123-0.7", filedefs={
|
||||
- 'tests': {'test_hello.py': "def test_hello(): pass"},
|
||||
@@ -466,8 +500,7 @@
|
||||
- packages=['pkg123',],
|
||||
- install_requires=['qweqwe123'],
|
||||
- )
|
||||
- """
|
||||
- ,
|
||||
- """,
|
||||
- 'tox.ini': '',
|
||||
- })
|
||||
- result = cmd.run("tox", )
|
||||
@@ -477,14 +510,14 @@
|
||||
- ])
|
||||
-
|
||||
-
|
||||
-
|
||||
-class TestToxRun:
|
||||
- @pytest.fixture
|
||||
- def example123(self, initproj):
|
||||
- initproj("example123-0.5", filedefs={
|
||||
- 'tests': {'test_hello.py': """
|
||||
- def test_hello(pytestconfig):
|
||||
- pass
|
||||
- 'tests': {
|
||||
- 'test_hello.py': """
|
||||
- def test_hello(pytestconfig):
|
||||
- pass
|
||||
- """,
|
||||
- },
|
||||
- 'tox.ini': '''
|
||||
@@ -546,6 +579,7 @@
|
||||
- assert not result.ret
|
||||
- assert "sdist-make" not in result.stdout.str()
|
||||
-
|
||||
-
|
||||
-def test_usedevelop(initproj, cmd):
|
||||
- initproj("example123", filedefs={'tox.ini': """
|
||||
- [testenv]
|
||||
@@ -555,6 +589,7 @@
|
||||
- assert not result.ret
|
||||
- assert "sdist-make" not in result.stdout.str()
|
||||
-
|
||||
-
|
||||
-def test_usedevelop_mixed(initproj, cmd):
|
||||
- initproj("example123", filedefs={'tox.ini': """
|
||||
- [testenv:devenv]
|
||||
@@ -573,11 +608,13 @@
|
||||
- assert not result.ret
|
||||
- assert "sdist-make" in result.stdout.str()
|
||||
-
|
||||
-
|
||||
-def test_test_usedevelop(cmd, initproj):
|
||||
- initproj("example123-0.5", filedefs={
|
||||
- 'tests': {'test_hello.py': """
|
||||
- def test_hello(pytestconfig):
|
||||
- pass
|
||||
- 'tests': {
|
||||
- 'test_hello.py': """
|
||||
- def test_hello(pytestconfig):
|
||||
- pass
|
||||
- """,
|
||||
- },
|
||||
- 'tox.ini': '''
|
||||
@@ -639,6 +676,7 @@
|
||||
- result = cmd.run("tox")
|
||||
- assert not result.ret
|
||||
-
|
||||
-
|
||||
-def test_notest(initproj, cmd):
|
||||
- initproj("example123", filedefs={'tox.ini': """
|
||||
- # content of: tox.ini
|
||||
@@ -657,6 +695,7 @@
|
||||
- "*py26*reusing*",
|
||||
- ])
|
||||
-
|
||||
-
|
||||
-def test_PYC(initproj, cmd, monkeypatch):
|
||||
- initproj("example123", filedefs={'tox.ini': ''})
|
||||
- monkeypatch.setenv("PYTHONDOWNWRITEBYTECODE", 1)
|
||||
@@ -666,6 +705,7 @@
|
||||
- "*create*",
|
||||
- ])
|
||||
-
|
||||
-
|
||||
-def test_env_VIRTUALENV_PYTHON(initproj, cmd, monkeypatch):
|
||||
- initproj("example123", filedefs={'tox.ini': ''})
|
||||
- monkeypatch.setenv("VIRTUALENV_PYTHON", '/FOO')
|
||||
@@ -675,6 +715,7 @@
|
||||
- "*create*",
|
||||
- ])
|
||||
-
|
||||
-
|
||||
-def test_sdistonly(initproj, cmd):
|
||||
- initproj("example123", filedefs={'tox.ini': """
|
||||
- """})
|
||||
@@ -685,6 +726,7 @@
|
||||
- ])
|
||||
- assert "-mvirtualenv" not in result.stdout.str()
|
||||
-
|
||||
-
|
||||
-def test_separate_sdist_no_sdistfile(cmd, initproj):
|
||||
- distshare = cmd.tmpdir.join("distshare")
|
||||
- initproj(("pkg123-foo", "0.7"), filedefs={
|
||||
@@ -700,6 +742,7 @@
|
||||
- sdistfile = l[0]
|
||||
- assert 'pkg123-foo-0.7.zip' in str(sdistfile)
|
||||
-
|
||||
-
|
||||
-def test_separate_sdist(cmd, initproj):
|
||||
- distshare = cmd.tmpdir.join("distshare")
|
||||
- initproj("pkg123-0.7", filedefs={
|
||||
@@ -731,16 +774,18 @@
|
||||
- p = distshare.ensure("pkg123-1.4.5.zip")
|
||||
- distshare.ensure("pkg123-1.4.5a1.zip")
|
||||
- session = Session(config)
|
||||
- sdist_path = session.sdist()
|
||||
- sdist_path = session.get_installpkg_path()
|
||||
- assert sdist_path == p
|
||||
-
|
||||
-
|
||||
-def test_installpkg(tmpdir, newconfig):
|
||||
- p = tmpdir.ensure("pkg123-1.0.zip")
|
||||
- config = newconfig(["--installpkg=%s" % p], "")
|
||||
- session = Session(config)
|
||||
- sdist_path = session.sdist()
|
||||
- sdist_path = session.get_installpkg_path()
|
||||
- assert sdist_path == p
|
||||
-
|
||||
-
|
||||
-@pytest.mark.xfail("sys.platform == 'win32' and sys.version_info < (2,6)",
|
||||
- reason="test needs better impl")
|
||||
-def test_envsitepackagesdir(cmd, initproj):
|
||||
@@ -756,6 +801,7 @@
|
||||
- X:*tox*site-packages*
|
||||
- """)
|
||||
-
|
||||
-
|
||||
-def verify_json_report_format(data, testenvs=True):
|
||||
- assert data["reportversion"] == "1"
|
||||
- assert data["toxversion"] == tox.__version__
|
||||
@@ -767,8 +813,9 @@
|
||||
- for command in envdata[commandtype]:
|
||||
- assert command["output"]
|
||||
- assert command["retcode"]
|
||||
- pyinfo = envdata["python"]
|
||||
- assert isinstance(pyinfo["version_info"], list)
|
||||
- assert pyinfo["version"]
|
||||
- assert pyinfo["executable"]
|
||||
-
|
||||
- if envname != "GLOB":
|
||||
- assert isinstance(envdata["installed_packages"], list)
|
||||
- pyinfo = envdata["python"]
|
||||
- assert isinstance(pyinfo["version_info"], list)
|
||||
- assert pyinfo["version"]
|
||||
- assert pyinfo["executable"]
|
||||
|
Reference in New Issue
Block a user