You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ORPA-pyOpenRPA/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/dask/tests/test_compatibility.py

25 lines
571 B

import functools
from dask.compatibility import getargspec
def test_getargspec():
def func(x, y):
pass
assert getargspec(func).args == ['x', 'y']
func2 = functools.partial(func, 2)
# this is a bit of a lie, but maybe close enough
assert getargspec(func2).args == ['x', 'y']
def wrapper(*args, **kwargs):
pass
wrapper.__wrapped__ = func
assert getargspec(wrapper).args == ['x', 'y']
class MyType(object):
def __init__(self, x, y):
pass
assert getargspec(MyType).args == ['self', 'x', 'y']