avoid helper functions showing up in py.test tracebacks
--HG-- branch : trunk
This commit is contained in:
parent
f266c8f92f
commit
0f5ed3abc7
|
@ -1,3 +1,9 @@
|
|||
Changes between 1.3.0 and 1.3.1
|
||||
==================================================
|
||||
|
||||
- improve tracebacks showing:
|
||||
- raises shows shorter more relevant tracebacks
|
||||
|
||||
Changes between 1.2.1 and 1.3.0
|
||||
==================================================
|
||||
|
||||
|
|
|
@ -175,6 +175,7 @@ else:
|
|||
|
||||
def exec_(obj, globals=None, locals=None):
|
||||
""" minimal backport of py3k exec statement. """
|
||||
__tracebackhide__ = True
|
||||
if globals is None:
|
||||
frame = sys._getframe(1)
|
||||
globals = frame.f_globals
|
||||
|
@ -187,14 +188,17 @@ else:
|
|||
if sys.version_info >= (3,0):
|
||||
exec ("""
|
||||
def _reraise(cls, val, tb):
|
||||
__tracebackhide__ = True
|
||||
assert hasattr(val, '__traceback__')
|
||||
raise val
|
||||
""")
|
||||
else:
|
||||
exec ("""
|
||||
def _reraise(cls, val, tb):
|
||||
__tracebackhide__ = True
|
||||
raise cls, val, tb
|
||||
def exec2(obj, globals, locals):
|
||||
__tracebackhide__ = True
|
||||
exec obj in globals, locals
|
||||
""")
|
||||
|
||||
|
|
Loading…
Reference in New Issue