diff options
author | George Peristerakis <george.peristerakis@enovance.com> | 2014-06-19 16:19:44 -0400 |
---|---|---|
committer | George Peristerakis <george.peristerakis@enovance.com> | 2014-06-20 11:12:17 -0400 |
commit | 4fc793fce5a59feb8beab59178480414a4e1db25 (patch) | |
tree | ea28f4a5adb1fb24f57f158aba87dc82243501f4 | |
parent | aed8d7c46ee2115734153a5f752ef599aa3713c6 (diff) | |
download | oslotest-4fc793fce5a59feb8beab59178480414a4e1db25.tar.gz |
Moving to use the mock module found in Python3
Change-Id: I6a2af0405b8628d4589ce7edb56f10935d5112ea
-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 f84e810..e93096d 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 @@ -29,4 +29,6 @@ exclude = .tox,dist,doc,*.egg,build builtins = _ [hacking] -import_exceptions = six.moves.mox +import_exceptions = + six.moves.mock + six.moves.mox |