Esempio n. 1
0
def test_func_keyword():
    def f(func=None):
        pass
    assert is_valid_args(f, (), {})
    assert is_valid_args(f, (None,), {})
    assert is_valid_args(f, (), {'func': None})
    assert is_valid_args(f, (None,), {'func': None}) is False
    assert is_partial_args(f, (), {})
    assert is_partial_args(f, (None,), {})
    assert is_partial_args(f, (), {'func': None})
    assert is_partial_args(f, (None,), {'func': None}) is False
Esempio n. 2
0
 def is_missing(modname, name, func):
     if name.startswith('_') and not name.startswith('__'):
         return False
     try:
         if issubclass(func, BaseException):
             return False
     except TypeError:
         pass
     try:
         return (callable(func) and modname in func.__module__
                 and is_partial_args(func, (), {}) is not True
                 and func not in blacklist)
     except AttributeError:
         return False
Esempio n. 3
0
 def is_missing(modname, name, func):
     if name.startswith('_') and not name.startswith('__'):
         return False
     try:
         if issubclass(func, BaseException):
             return False
     except TypeError:
         pass
     try:
         return (callable(func) and modname in func.__module__
                 and is_partial_args(func, (), {}) is not True
                 and func not in blacklist)
     except AttributeError:
         return False