Пример #1
0
def test_arguments_of():
    def f(a, b=2, c=None, *args, **kwargs):
        pass

    defaults = utils.arguments_of(f)
    assert defaults == ["a", "b", "c", "args", "kwargs"]
Пример #2
0
def test_arguments_of_no_args():
    def f():
        pass

    defaults = utils.arguments_of(f)
    assert defaults == []
Пример #3
0
def test_arguments_of():
    def f(a, b=2, c=None, *args, **kwargs):
        pass

    defaults = utils.arguments_of(f)
    assert defaults == ['a', 'b', 'c', 'args', 'kwargs']