Пример #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
Пример #2
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
Пример #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 func.__module__ is not None
                 and modname in func.__module__
                 and is_partial_args(func, (), {}) is not True
                 and func not in blacklist)
     except AttributeError:
         return False
Пример #4
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 func.__module__ is not None
                 and modname in func.__module__
                 and is_partial_args(func, (), {}) is not True
                 and func not in blacklist)
     except AttributeError:
         return False