Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
tvault-contego / home / tvault / .virtenv / lib / python2.7 / site-packages / dask / tests / test_compatibility.py
Size: Mime:
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']