示例#1
0
def test_get_callable_description_nested_lambda():
    foo = Namespace(bar=lambda x: x)

    description = get_callable_description(foo)
    assert description.startswith(
        '`Namespace(bar=<function test_get_callable_description_nested_lambda.<locals>.<lambda> at'
    )
    assert description.endswith('`')
示例#2
0
def test_get_callable_description():
    # noinspection PyUnusedLocal
    def foo(a, b, c, *, bar, **kwargs):
        assert False  # pragma: no cover

    description = get_callable_description(foo)
    assert description.startswith(
        '`<function test_get_callable_description.<locals>.foo at')
    assert description.endswith('`')