예제 #1
0
def test_wrapped_getfslineno():
    def func():
        pass
    def wrap(f):
        func.__wrapped__ = f
        func.patchings = ["qwe"]
        return func
    @wrap
    def wrapped_func(x, y, z):
        pass
    fs, lineno = python.getfslineno(wrapped_func)
    fs2, lineno2 = python.getfslineno(wrap)
    assert lineno > lineno2, "getfslineno does not unwrap correctly"
예제 #2
0
def test_wrapped_getfslineno():
    def func():
        pass

    def wrap(f):
        func.__wrapped__ = f
        func.patchings = ["qwe"]
        return func

    @wrap
    def wrapped_func(x, y, z):
        pass
    fs, lineno = python.getfslineno(wrapped_func)
    fs2, lineno2 = python.getfslineno(wrap)
    assert lineno > lineno2, "getfslineno does not unwrap correctly"