diff options
| author | Monty Taylor <mordred@inaugust.com> | 2013-07-11 11:36:21 -0400 |
|---|---|---|
| committer | Monty Taylor <mordred@inaugust.com> | 2013-07-11 11:36:21 -0400 |
| commit | df4e4dbdae3cba3cd096787846f2b54111f9de28 (patch) | |
| tree | fbe70ba1136e0424b8a3d4532d3ccbeb293fb15d | |
| parent | 00a35f6857b46e2486ac8936bda4ecf3edfb2b6e (diff) | |
| download | tox-df4e4dbdae3cba3cd096787846f2b54111f9de28.tar.gz | |
Add test to use usedevelop
While we're at it, fix the error that adding the test found.
| -rw-r--r-- | tests/test_z_cmdline.py | 53 | ||||
| -rw-r--r-- | tox/_venv.py | 4 |
2 files changed, 55 insertions, 2 deletions
diff --git a/tests/test_z_cmdline.py b/tests/test_z_cmdline.py index 12628e3..b45cab4 100644 --- a/tests/test_z_cmdline.py +++ b/tests/test_z_cmdline.py @@ -359,6 +359,59 @@ def test_test_simple(cmd, initproj): ]) +def test_test_develop(cmd, initproj): + initproj("example123-0.5", filedefs={ + 'tests': {'test_hello.py': """ + def test_hello(pytestconfig): + pass + """, + }, + 'tox.ini': ''' + [tox] + usedevelop=True + [testenv] + changedir=tests + commands= + py.test --basetemp={envtmpdir} --junitxml=junit-{envname}.xml [] + deps=pytest + ''' + }) + result = cmd.run("tox") + assert not result.ret + result.stdout.fnmatch_lines([ + "*junit-python.xml*", + "*1 passed*", + ]) + result = cmd.run("tox", "-epython", ) + assert not result.ret + result.stdout.fnmatch_lines([ + "*1 passed*", + "*summary*", + "*python: commands succeeded" + ]) + # see that things work with a different CWD + old = cmd.tmpdir.chdir() + result = cmd.run("tox", "-c", "example123/tox.ini") + assert not result.ret + result.stdout.fnmatch_lines([ + "*1 passed*", + "*summary*", + "*python: commands succeeded" + ]) + old.chdir() + # see that tests can also fail and retcode is correct + testfile = py.path.local("tests").join("test_hello.py") + assert testfile.check() + testfile.write("def test_fail(): assert 0") + result = cmd.run("tox", ) + assert result.ret + result.stdout.fnmatch_lines([ + "*1 failed*", + "*summary*", + "*python: *failed*", + ]) + + def test_test_piphelp(initproj, cmd): initproj("example123", filedefs={'tox.ini': """ # content of: tox.ini diff --git a/tox/_venv.py b/tox/_venv.py index 7b7f4e6..d25f1b2 100644 --- a/tox/_venv.py +++ b/tox/_venv.py @@ -209,8 +209,8 @@ class VirtualEnv(object): name = output.strip().decode('utf-8') egg_info = setupdir.join('.'.join((name, 'egg-info'))) for conf_file in (setup_py, setup_cfg): - if (conf_file.check() - and conf_file.mtime() > egg_info.mtime()): + if (not egg_info.check() or (conf_file.check() + and conf_file.mtime() > egg_info.mtime())): return True return False |
