* moving in test, misc, code, io directories and py/__init__.py * py/bin/_find.py does not print to stderr anymore * a few fixes to conftest files in other dirs some more fixes and adjustments pending --HG-- branch : trunk
16 lines
404 B
Python
16 lines
404 B
Python
import sys
|
|
import py
|
|
|
|
def test_frame_getsourcelineno_myself():
|
|
def func():
|
|
return sys._getframe(0)
|
|
f = func()
|
|
f = py.code.Frame(f)
|
|
source, lineno = f.code.fullsource, f.lineno
|
|
assert source[lineno].startswith(" return sys._getframe(0)")
|
|
|
|
def test_code_from_func():
|
|
co = py.code.Code(test_frame_getsourcelineno_myself)
|
|
assert co.firstlineno
|
|
assert co.path
|