File Manager

Current Path : /usr/lib/python3/dist-packages/hamcrest/core/helpers/
Upload File :
Current File : //usr/lib/python3/dist-packages/hamcrest/core/helpers/ismock.py

from typing import Any, List, Type

MOCKTYPES = []  # type: List[Type]
try:
    from mock import Mock

    MOCKTYPES += [Mock]
except ImportError:
    pass
try:
    from unittest.mock import Mock

    MOCKTYPES += [Mock]
except ImportError:
    pass


def ismock(obj: Any) -> bool:
    return isinstance(obj, tuple(MOCKTYPES))

File Manager Version 1.0, Coded By Lucas
Email: hehe@yahoo.com