fix test to work on jython and cpy

--HG--
branch : trunk
This commit is contained in:
holger krekel 2010-05-14 15:25:24 +02:00
parent 91880ffc19
commit f97e082543
1 changed files with 2 additions and 5 deletions

View File

@ -374,10 +374,7 @@ def test_getfslineno():
fspath, lineno = getfslineno(f) fspath, lineno = getfslineno(f)
fname = __file__ assert fspath.basename == "test_source.py"
fname = fname[:fname.find('.py')] + '.py'
assert fspath == py.path.local(fname)
assert lineno == py.code.getrawcode(f).co_firstlineno-1 # see findsource assert lineno == py.code.getrawcode(f).co_firstlineno-1 # see findsource
class A(object): class A(object):
@ -386,5 +383,5 @@ def test_getfslineno():
fspath, lineno = getfslineno(A) fspath, lineno = getfslineno(A)
_, A_lineno = py.std.inspect.findsource(A) _, A_lineno = py.std.inspect.findsource(A)
assert fspath == py.path.local(fname) assert fspath.basename == "test_source.py"
assert lineno == A_lineno assert lineno == A_lineno