Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, x):
pass
class D:
pass
class E(object):
def __init__(self, x):
pass
class F(object):
pass
assert varnames(C) == ("x",)
assert varnames(D) == ()
assert varnames(E) == ("x",)
assert varnames(F) == ()
def test_varnames_class():
class C(object):
def __init__(self, x):
pass
class D(object):
pass
class E(object):
def __init__(self, x):
pass
class F(object):
pass
assert varnames(C) == (("x",), ())
assert varnames(D) == ((), ())
assert varnames(E) == (("x",), ())
assert varnames(F) == ((), ())
def test_varnames():
def f(x):
i = 3 # noqa
class A:
def f(self, y):
pass
class B(object):
def __call__(self, z):
pass
assert varnames(f) == ("x",)
assert varnames(A().f) == ('y',)
assert varnames(B()) == ('z',)
def test_varnames():
def f(x):
i = 3 # noqa
class A(object):
def f(self, y):
pass
class B(object):
def __call__(self, z):
pass
assert varnames(f) == (("x",), ())
assert varnames(A().f) == (('y',), ())
assert varnames(B()) == (('z',), ())
pass
class D:
pass
class E(object):
def __init__(self, x):
pass
class F(object):
pass
assert varnames(C) == ("x",)
assert varnames(D) == ()
assert varnames(E) == ("x",)
assert varnames(F) == ()
def test_varnames():
def f(x):
i = 3 # noqa
class A:
def f(self, y):
pass
class B(object):
def __call__(self, z):
pass
assert varnames(f) == ("x",)
assert varnames(A().f) == ('y',)
assert varnames(B()) == ('z',)
def test_varnames():
def f(x):
i = 3 # noqa
class A(object):
def f(self, y):
pass
class B(object):
def __call__(self, z):
pass
assert varnames(f) == (("x",), ())
assert varnames(A().f) == (('y',), ())
assert varnames(B()) == (('z',), ())
class C(object):
def __init__(self, x):
pass
class D(object):
pass
class E(object):
def __init__(self, x):
pass
class F(object):
pass
assert varnames(C) == (("x",), ())
assert varnames(D) == ((), ())
assert varnames(E) == (("x",), ())
assert varnames(F) == ((), ())
def test_varnames():
def f(x):
i = 3 # noqa
class A(object):
def f(self, y):
pass
class B(object):
def __call__(self, z):
pass
assert varnames(f) == (("x",), ())
assert varnames(A().f) == (('y',), ())
assert varnames(B()) == (('z',), ())
def test_varnames_default():
def f(x, y=3):
pass
assert varnames(f) == ("x",)