Mock, MagicMock, patch, sentinel, DEFAULT, # ANY and call will be imported further down create_autospec, FILTER_DIR, NonCallableMock, NonCallableMagicMock, PropertyMock, __version__ as __mock_version) NO_MOCK = False NO_MOCK_REASON = '' mock_version = [] for __part in __mock_version.split('.'): try: mock_version.append(int(__part)) except ValueError: # Non-integer value (ex. '1a') mock_version.append(__part) mock_version = tuple(mock_version) except ImportError as exc: NO_MOCK = True NO_MOCK_REASON = 'mock python module is unavailable' mock_version = (0, 0, 0) # Let's not fail on imports by providing fake objects and classes class MagicMock(object):
Mock, MagicMock, patch, sentinel, DEFAULT, # ANY and call will be imported further down create_autospec, FILTER_DIR, NonCallableMock, NonCallableMagicMock, PropertyMock, __version__) NO_MOCK = False NO_MOCK_REASON = '' mock_version = [] for __part in __version__.split('.'): try: mock_version.append(int(__part)) except ValueError: # Non-integer value (ex. '1a') mock_version.append(__part) mock_version = tuple(mock_version) except ImportError as exc: NO_MOCK = True NO_MOCK_REASON = 'mock python module is unavailable' mock_version = (0, 0, 0) # Let's not fail on imports by providing fake objects and classes class MagicMock(object):
MagicMock, patch, sentinel, DEFAULT, # ANY and call will be imported further down create_autospec, FILTER_DIR, NonCallableMock, NonCallableMagicMock, PropertyMock, __version__ as __mock_version ) NO_MOCK = False NO_MOCK_REASON = '' mock_version = [] for __part in __mock_version.split('.'): try: mock_version.append(int(__part)) except ValueError: # Non-integer value (ex. '1a') mock_version.append(__part) mock_version = tuple(mock_version) except ImportError as exc: NO_MOCK = True NO_MOCK_REASON = 'mock python module is unavailable' mock_version = (0, 0, 0) # Let's not fail on imports by providing fake objects and classes class MagicMock(object):