Have unittests import mock from ansible.compat so they work on py3 without mock installed from pypi
This commit is contained in:
parent
ebc4d577de
commit
0139298786
4 changed files with 6 additions and 8 deletions
|
@ -24,11 +24,9 @@ import shutil
|
|||
import tarfile
|
||||
import tempfile
|
||||
|
||||
from mock import patch
|
||||
|
||||
from ansible.compat.six import PY3
|
||||
from ansible.compat.tests import unittest
|
||||
from mock import patch, call
|
||||
from ansible.compat.tests.mock import call, patch
|
||||
|
||||
import ansible
|
||||
from ansible.errors import AnsibleError, AnsibleOptionsError
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import collections
|
||||
import mock
|
||||
import os
|
||||
import re
|
||||
|
||||
|
@ -24,6 +23,8 @@ except ImportError:
|
|||
else: excName = str(expected)
|
||||
raise AssertionError("%s not raised" % excName)
|
||||
|
||||
from ansible.compat.tests import mock
|
||||
|
||||
from ansible.module_utils.database import (
|
||||
pg_quote_identifier,
|
||||
SQLParseError,
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import collections
|
||||
import mock
|
||||
import os
|
||||
import sys
|
||||
from ansible.compat.tests import unittest
|
||||
|
||||
from ansible.compat.tests import mock
|
||||
from ansible.compat.tests import unittest
|
||||
|
||||
try:
|
||||
from ansible.modules.core.packaging.os.apt import (
|
||||
|
|
|
@ -21,8 +21,7 @@ __metaclass__ = type
|
|||
|
||||
from io import StringIO
|
||||
|
||||
import mock
|
||||
|
||||
from ansible.compat.tests import mock
|
||||
from ansible.compat.tests import unittest
|
||||
from ansible.errors import AnsibleError
|
||||
from ansible.playbook.play_context import PlayContext
|
||||
|
|
Loading…
Reference in a new issue