From fe54762b93a32955cb64df1bb215b7145ee7f183 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Wed, 6 Oct 2010 09:40:14 +0200 Subject: [PATCH] fix tests to avoid pyc-caching and skip python2.4 which doesn't support "python -m" on packages. --HG-- branch : trunk --- CHANGELOG | 1 + testing/acceptance_test.py | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 8450fa267..6b622742e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,7 @@ Changes between 1.3.4 and 1.4.0.dev0 ================================================== - fix issue123 - new "python -m py.test" invocation for py.test + (requires Python 2.5 or above) - fix issue124 - make reporting more resilient against tests opening files on filedescriptor 1 (stdout). - fix issue109 - sibling conftest.py files will not be loaded. diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 720f29cc6..6314c1041 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -209,10 +209,14 @@ class TestGeneralUsage: ]) - def test_python_minus_m_invocation(self, testdir): + @py.test.mark.skipif("sys.version_info < (2,5)") + def test_python_minus_m_invocation_ok(self, testdir): p1 = testdir.makepyfile("def test_hello(): pass") res = testdir.run(py.std.sys.executable, "-m", "py.test", str(p1)) assert res.ret == 0 - p2 = testdir.makepyfile("def test_world(): 0/0") - res = testdir.run(py.std.sys.executable, "-m", "py.test", str(p2)) + + @py.test.mark.skipif("sys.version_info < (2,5)") + def test_python_minus_m_invocation_fail(self, testdir): + p1 = testdir.makepyfile("def test_fail(): 0/0") + res = testdir.run(py.std.sys.executable, "-m", "py.test", str(p1)) assert res.ret == 1