Exemple #1
0
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
    """)
Exemple #2
0
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
    """)
Exemple #3
0
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
    """)
Exemple #4
0
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
    """)
Exemple #5
0
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
    """)
Exemple #6
0
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
    """)