diff options
author | Jenkins <jenkins@review.openstack.org> | 2014-07-11 19:39:42 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2014-07-11 19:39:42 +0000 |
commit | 1fa6ddf6a25a4eb7d2d9cc2e2db9c16545c05588 (patch) | |
tree | 74c8398dea64740c70ec3005fd7a322943358718 | |
parent | 289d1dab8d3afa88451571ba8fe35e9b3f1aff51 (diff) | |
parent | 4fc793fce5a59feb8beab59178480414a4e1db25 (diff) | |
download | oslotest-1fa6ddf6a25a4eb7d2d9cc2e2db9c16545c05588.tar.gz |
Merge "Moving to use the mock module found in Python3"
-rw-r--r-- | oslotest/__init__.py | 3 | ||||
-rw-r--r-- | oslotest/base.py | 2 | ||||
-rw-r--r-- | oslotest/mockpatch.py | 2 | ||||
-rw-r--r-- | requirements-py3.txt | 1 | ||||
-rw-r--r-- | tests/__init__.py | 16 | ||||
-rw-r--r-- | tests/unit/test_base.py | 2 | ||||
-rw-r--r-- | tests/unit/test_mockpatch.py | 2 | ||||
-rw-r--r-- | tox.ini | 4 |
8 files changed, 26 insertions, 6 deletions
diff --git a/oslotest/__init__.py b/oslotest/__init__.py index 7916f5d..2c9a3cd 100644 --- a/oslotest/__init__.py +++ b/oslotest/__init__.py @@ -11,4 +11,7 @@ # under the License. import six + + +six.add_move(six.MovedModule('mock', 'mock', 'unittest.mock')) six.add_move(six.MovedModule('mox', 'mox', 'mox3.mox')) diff --git a/oslotest/base.py b/oslotest/base.py index c1cad3d..a9b3c14 100644 --- a/oslotest/base.py +++ b/oslotest/base.py @@ -20,7 +20,7 @@ import os import tempfile import fixtures -import mock +from six.moves import mock import testtools _TRUE_VALUES = ('True', 'true', '1', 'yes') diff --git a/oslotest/mockpatch.py b/oslotest/mockpatch.py index a8ffeb3..cf4c735 100644 --- a/oslotest/mockpatch.py +++ b/oslotest/mockpatch.py @@ -16,7 +16,7 @@ # under the License. import fixtures -import mock +from six.moves import mock class PatchObject(fixtures.Fixture): diff --git a/requirements-py3.txt b/requirements-py3.txt index 2750781..6789ace 100644 --- a/requirements-py3.txt +++ b/requirements-py3.txt @@ -4,5 +4,4 @@ python-subunit>=0.0.18 testscenarios>=0.4 testrepository>=0.0.18 testtools>=0.9.34 -mock>=1.0 mox3>=0.7.0 diff --git a/tests/__init__.py b/tests/__init__.py index e69de29..e3f05f9 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -0,0 +1,16 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import six + + +six.add_move(six.MovedModule('mock', 'mock', 'unittest.mock')) diff --git a/tests/unit/test_base.py b/tests/unit/test_base.py index 8b76cc9..b918586 100644 --- a/tests/unit/test_base.py +++ b/tests/unit/test_base.py @@ -15,7 +15,7 @@ import logging import unittest -import mock +from six.moves import mock import testtools from oslotest import base diff --git a/tests/unit/test_mockpatch.py b/tests/unit/test_mockpatch.py index 879f040..d3bc12d 100644 --- a/tests/unit/test_mockpatch.py +++ b/tests/unit/test_mockpatch.py @@ -13,7 +13,7 @@ # under the License. -import mock +from six.moves import mock from oslotest import base from oslotest import mockpatch @@ -32,4 +32,6 @@ exclude = .tox,dist,doc,*.egg,build builtins = _ [hacking] -import_exceptions = six.moves.mox +import_exceptions = + six.moves.mock + six.moves.mox |