Debian Codegraph @

ansible_collections/dellemc/enterprise_sonic/tests/unit/compat/mock.py

raw symbols SCIP
1 """
2 Compatibility shim for mock imports in modules and module_utils.
3 This can be removed once support for Python 2.7 is dropped.
4 """
5 from __future__ import (absolute_import, division, print_function)
6 __metaclass__ = type
7
8 try:
9 from unittest.mock import ( # pylint: disable=unused-import
10 call,
11 patch,
12 mock_open,
13 MagicMock,
14 Mock,
15 )
16 except ImportError:
17 from mock import (
18 call,
19 patch,
20 mock_open,
21 MagicMock,
22 Mock,
23 )