def test_hidden_pytest_frames(): def g(): __tracebackhide__ = True set_trace() return 'foo' def k(g=g): return g() k = pdb.rebind_globals(k, {'__tracebackhide__': True}) def fn(): k() return 1 check( fn, """ [NUM] > .*fn() -> k() 2 frames hidden .* # hf_list .*k() -> return g() .*g() -> return 'foo' # c """)
def test_hidden_unittest_frames(): def g(set_trace=set_trace): set_trace() return 'foo' g = pdb.rebind_globals(g, {'__unittest': True}) def fn(): return g() check( fn, r""" [NUM] > .*fn() -> return g() 6 frames hidden .* # hf_list .*_multicall() -> res = hook_impl.function(\*args) .*_multicall() -> res = hook_impl.function(\*args) .*_multicall() -> res = hook_impl.function(\*args) .*_multicall() -> res = hook_impl.function(\*args) .*_multicall() -> res = hook_impl.function(\*args) .*g() -> return 'foo' # c """)
def test_hidden_pytest_frames(): def g(): __tracebackhide__ = True set_trace() return 'foo' def k(g=g): return g() k = pdb.rebind_globals(k, {'__tracebackhide__': True}) def fn(): k() return 1 check(fn, r""" [NUM] > .*fn() -> k() 7 frames hidden .* # hf_list .*_multicall() -> res = hook_impl.function(\*args) .*_multicall() -> res = hook_impl.function(\*args) .*_multicall() -> res = hook_impl.function(\*args) .*_multicall() -> res = hook_impl.function(\*args) .*_multicall() -> res = hook_impl.function(\*args) .*k() -> return g() .*g() -> return 'foo' # c """)
def test_hidden_unittest_frames(): def g(set_trace=set_trace): set_trace() return 'foo' g = pdb.rebind_globals(g, {'__unittest':True}) def fn(): return g() check(fn, """ [NUM] > .*fn() -> return g() 1 frame hidden .* # hf_list .*g() -> return 'foo' # c """)
def test_hidden_unittest_frames(): def g(set_trace=set_trace): set_trace() return 'foo' g = pdb.rebind_globals(g, {'__unittest': True}) def fn(): return g() check( fn, """ [NUM] > .*fn() -> return g() 1 frame hidden .* # hf_list .*g() -> return 'foo' # c """)
def test_hidden_pytest_frames(): def g(): __tracebackhide__ = True set_trace() return 'foo' def k(g=g): return g() k = pdb.rebind_globals(k, {'__tracebackhide__': True}) def fn(): k() return 1 check(fn, """ [NUM] > .*fn() -> k() 2 frames hidden .* # hf_list .*k() -> return g() .*g() -> return 'foo' # c """)