1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Have unittests import mock from ansible.compat so they work on py3 without mock installed from pypi

This commit is contained in:
Toshio Kuratomi 2016-09-13 10:50:05 -07:00
parent ebc4d577de
commit 0139298786
4 changed files with 6 additions and 8 deletions

View file

@ -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

View file

@ -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,

View file

@ -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 (

View file

@ -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