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.
25 lines
571 B
25 lines
571 B
6 years ago
|
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']
|