Пример #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"