mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
476 B
Python
24 lines
476 B
Python
3 years ago
|
"""
|
||
|
Compatibility shim for mock imports in modules and module_utils.
|
||
|
This can be removed once support for Python 2.7 is dropped.
|
||
|
"""
|
||
|
from __future__ import (absolute_import, division, print_function)
|
||
|
__metaclass__ = type
|
||
|
|
||
|
try:
|
||
|
from unittest.mock import (
|
||
|
call,
|
||
|
patch,
|
||
|
mock_open,
|
||
|
MagicMock,
|
||
|
Mock,
|
||
|
)
|
||
|
except ImportError:
|
||
|
from mock import (
|
||
|
call,
|
||
|
patch,
|
||
|
mock_open,
|
||
|
MagicMock,
|
||
|
Mock,
|
||
|
)
|