Exemple #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"]
Exemple #2
0
def test_arguments_of_no_args():
    def f():
        pass

    defaults = utils.arguments_of(f)
    assert defaults == []
Exemple #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']