Browse Source

Use unittest.mock instead of third party mock

Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I597461bc2ce6a480ea18950ded606ef7db717f2d
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
tags/4.0.1^0
Sean McGinnis 3 months ago
parent
commit
34aaaf2eb5
No known key found for this signature in database GPG Key ID: CE7EE4BFAF8D70C8
9 changed files with 11 additions and 12 deletions
  1. +0
    -1
      lower-constraints.txt
  2. +2
    -1
      oslo_i18n/tests/test_factory.py
  3. +1
    -1
      oslo_i18n/tests/test_gettextutils.py
  4. +1
    -1
      oslo_i18n/tests/test_handler.py
  5. +2
    -1
      oslo_i18n/tests/test_logging.py
  6. +1
    -1
      oslo_i18n/tests/test_message.py
  7. +2
    -4
      oslo_i18n/tests/test_public_api.py
  8. +2
    -1
      oslo_i18n/tests/test_translate.py
  9. +0
    -1
      test-requirements.txt

+ 0
- 1
lower-constraints.txt View File

@@ -19,7 +19,6 @@ keystoneauth1==3.4.0
linecache2==1.0.0
MarkupSafe==1.0
mccabe==0.2.1
mock==2.0.0
mox3==0.20.0
netaddr==0.7.18
openstackdocstheme==1.18.1


+ 2
- 1
oslo_i18n/tests/test_factory.py View File

@@ -14,7 +14,8 @@
# License for the specific language governing permissions and limitations
# under the License.

import mock
from unittest import mock

from oslotest import base as test_base
import six



+ 1
- 1
oslo_i18n/tests/test_gettextutils.py View File

@@ -16,9 +16,9 @@

import gettext
import logging
from unittest import mock

from babel import localedata
import mock
from oslotest import base as test_base
import six



+ 1
- 1
oslo_i18n/tests/test_handler.py View File

@@ -15,8 +15,8 @@
# under the License.

import logging
from unittest import mock

import mock
from oslotest import base as test_base
import six



+ 2
- 1
oslo_i18n/tests/test_logging.py View File

@@ -14,7 +14,8 @@
# License for the specific language governing permissions and limitations
# under the License.

import mock
from unittest import mock

from oslotest import base as test_base

from oslo_i18n import _factory


+ 1
- 1
oslo_i18n/tests/test_message.py View File

@@ -17,9 +17,9 @@
from __future__ import unicode_literals

import logging
from unittest import mock
import warnings

import mock
from oslotest import base as test_base
import six
import testtools


+ 2
- 4
oslo_i18n/tests/test_public_api.py View File

@@ -9,12 +9,10 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""A few tests that use the public API to ensure the imports work.
"""
"""A few tests that use the public API to ensure the imports work."""

import unittest

import mock
from unittest import mock

import oslo_i18n
from oslo_i18n import _lazy


+ 2
- 1
oslo_i18n/tests/test_translate.py View File

@@ -16,7 +16,8 @@

from __future__ import unicode_literals

import mock
from unittest import mock

from oslotest import base as test_base

from oslo_i18n import _message


+ 0
- 1
test-requirements.txt View File

@@ -4,7 +4,6 @@
hacking>=3.0,<3.1.0 # Apache-2.0
stestr>=2.0.0 # Apache-2.0

mock>=2.0.0 # BSD
oslotest>=3.2.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
testscenarios>=0.4 # Apache-2.0/BSD


Loading…
Cancel
Save