From 8cbfaa1a4f81254983354c3d311055acc70b174b Mon Sep 17 00:00:00 2001 From: hpk Date: Thu, 17 Jul 2008 15:21:23 +0200 Subject: [PATCH] [svn r56618] skip this test for a more explicit reason --HG-- branch : trunk --- py/code/testing/test_source.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/py/code/testing/test_source.py b/py/code/testing/test_source.py index 79979085c..c224fc26f 100644 --- a/py/code/testing/test_source.py +++ b/py/code/testing/test_source.py @@ -282,14 +282,17 @@ def test_deindent(): lines = deindent(source.splitlines()) assert lines == ['', 'def f():', ' def g():', ' pass', ' '] -def test_write_read(): - py.test.skip("Failing") +def test_source_of_class_at_eof_without_newline(): + py.test.skip("circumvent CPython's buggy inspect.getsource?") + # this test fails because the implicit inspect.getsource(A) below + # does not return the "x = 1" last line. tmpdir = py.test.ensuretemp("source_write_read") source = py.code.Source(''' - class A(object): - def method(self): - x = 1 + class A(object): + def method(self): + x = 1 ''') - tmpdir.ensure("a.py").write(source) + path = tmpdir.join("a.py") + path.write(source) s2 = py.code.Source(tmpdir.join("a.py").pyimport().A) - assert source == s2 + assert str(source).strip() == str(s2).strip()