fix issue257 assertion-triggered compilation of source ending in a

comment line doesn't blow up in python2.5 (fixed through py>=1.4.13.dev6)
This commit is contained in:
holger krekel
2013-02-12 22:43:33 +01:00
parent c8653b4c02
commit 456731ed0f
4 changed files with 21 additions and 5 deletions

View File

@@ -103,6 +103,19 @@ class TestAssert_reprcompare:
expl = ' '.join(callequal('foo', 'bar'))
assert 'raised in repr()' not in expl
def test_python25_compile_issue257(testdir):
testdir.makepyfile("""
def test_rewritten():
assert 1 == 2
# some comment
""")
result = testdir.runpytest()
assert result.ret == 1
result.stdout.fnmatch_lines("""
*E*assert 1 == 2*
*1 failed*
""")
@needsnewassert
def test_rewritten(testdir):
testdir.makepyfile("""