How to use the pluggy.hooks.varnames function in pluggy

To help you get started, we’ve selected a few pluggy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pytest-dev / pluggy / testing / test_helpers.py View on Github external
def test_varnames_keyword_only():
    def f1(x, *, y):
        pass

    def f2(x, *, y=3):
        pass

    def f3(x=1, *, y=3):
        pass

    assert varnames(f1) == (("x",), ())
    assert varnames(f2) == (("x",), ())
    assert varnames(f3) == ((), ("x",))
github pytest-dev / pluggy / testing / test_helpers.py View on Github external
def test_varnames_class():
    class C:
        def __init__(self, x):
            pass

    class D:
        pass

    class E:
        def __init__(self, x):
            pass

    class F:
        pass

    assert varnames(C) == (("x",), ())
    assert varnames(D) == ((), ())
    assert varnames(E) == (("x",), ())
    assert varnames(F) == ((), ())
github pytest-dev / pluggy / testing / test_helpers.py View on Github external
def test_varnames():
    def f(x):
        i = 3  # noqa

    class A:
        def f(self, y):
            pass

    class B:
        def __call__(self, z):
            pass

    assert varnames(f) == (("x",), ())
    assert varnames(A().f) == (("y",), ())
    assert varnames(B()) == (("z",), ())
github pytest-dev / pluggy / testing / test_helpers.py View on Github external
class C:
        def __init__(self, x):
            pass

    class D:
        pass

    class E:
        def __init__(self, x):
            pass

    class F:
        pass

    assert varnames(C) == (("x",), ())
    assert varnames(D) == ((), ())
    assert varnames(E) == (("x",), ())
    assert varnames(F) == ((), ())
github pytest-dev / pluggy / testing / test_helpers.py View on Github external
def __init__(self, x):
            pass

    class D:
        pass

    class E:
        def __init__(self, x):
            pass

    class F:
        pass

    assert varnames(C) == (("x",), ())
    assert varnames(D) == ((), ())
    assert varnames(E) == (("x",), ())
    assert varnames(F) == ((), ())
github pytest-dev / pluggy / testing / test_helpers.py View on Github external
pass

    class D:
        pass

    class E:
        def __init__(self, x):
            pass

    class F:
        pass

    assert varnames(C) == (("x",), ())
    assert varnames(D) == ((), ())
    assert varnames(E) == (("x",), ())
    assert varnames(F) == ((), ())
github pytest-dev / pluggy / testing / test_helpers.py View on Github external
def test_varnames():
    def f(x):
        i = 3  # noqa

    class A:
        def f(self, y):
            pass

    class B:
        def __call__(self, z):
            pass

    assert varnames(f) == (("x",), ())
    assert varnames(A().f) == (("y",), ())
    assert varnames(B()) == (("z",), ())
github pytest-dev / pluggy / testing / test_helpers.py View on Github external
def test_varnames():
    def f(x):
        i = 3  # noqa

    class A:
        def f(self, y):
            pass

    class B:
        def __call__(self, z):
            pass

    assert varnames(f) == (("x",), ())
    assert varnames(A().f) == (("y",), ())
    assert varnames(B()) == (("z",), ())
github pytest-dev / pluggy / testing / test_helpers.py View on Github external
def test_varnames_keyword_only():
    def f1(x, *, y):
        pass

    def f2(x, *, y=3):
        pass

    def f3(x=1, *, y=3):
        pass

    assert varnames(f1) == (("x",), ())
    assert varnames(f2) == (("x",), ())
    assert varnames(f3) == ((), ("x",))
github pytest-dev / pluggy / testing / test_helpers.py View on Github external
def test_varnames_keyword_only():
    def f1(x, *, y):
        pass

    def f2(x, *, y=3):
        pass

    def f3(x=1, *, y=3):
        pass

    assert varnames(f1) == (("x",), ())
    assert varnames(f2) == (("x",), ())
    assert varnames(f3) == ((), ("x",))