[py-svn] py-trunk commit 9684ef61e64e: fixing test for python2.4 (thanks ronny)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Sep 8 18:33:09 CEST 2010


# HG changeset patch -- Bitbucket.org
# Project py-trunk
# URL http://bitbucket.org/hpk42/py-trunk/overview
# User holger krekel <holger at merlinux.eu>
# Date 1283963366 -7200
# Node ID 9684ef61e64e3e4828bf043448a0cd0363fab321
# Parent  91d8df794e911a3ab44c0f125857537dbc698af6
fixing test for python2.4 (thanks ronny)

--- a/testing/code/test_excinfo.py
+++ b/testing/code/test_excinfo.py
@@ -708,4 +708,8 @@ raise ValueError()
         """)
         repr = excinfo.getrepr(style='native')
         assert repr.startswith('Traceback (most recent call last):\n  File')
-        assert repr.endswith('\n    assert 0\nAssertionError: assert 0\n')
+        assert repr.endswith('\nAssertionError: assert 0\n')
+        assert 'exec (source.compile())' in repr
+        # python 2.4 fails to get the source line for the assert
+        if py.std.sys.version_info >= (2, 5):
+            assert repr.count('assert 0') == 2



More information about the pytest-commit mailing list