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: I26f2df6d4657133a5c7e6ed85298aa843c1bdd73
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
tags/2.0.2^0
Sean McGinnis 3 months ago
parent
commit
4d2310b2a9
No known key found for this signature in database GPG Key ID: CE7EE4BFAF8D70C8
8 changed files with 8 additions and 11 deletions
  1. +0
    -1
      lower-constraints.txt
  2. +3
    -2
      oslo_versionedobjects/fixture.py
  3. +1
    -1
      oslo_versionedobjects/test.py
  4. +1
    -3
      oslo_versionedobjects/tests/test_exception.py
  5. +1
    -1
      oslo_versionedobjects/tests/test_fields.py
  6. +1
    -1
      oslo_versionedobjects/tests/test_fixture.py
  7. +1
    -1
      oslo_versionedobjects/tests/test_objects.py
  8. +0
    -1
      test-requirements.txt

+ 0
- 1
lower-constraints.txt View File

@@ -24,7 +24,6 @@ kombu==4.0.0
linecache2==1.0.0
MarkupSafe==1.0
mccabe==0.2.1
mock==2.0.0
mox3==0.20.0
msgpack-python==0.4.0
netaddr==0.7.18


+ 3
- 2
oslo_versionedobjects/fixture.py View File

@@ -27,10 +27,11 @@ import datetime
import hashlib
import inspect
import logging
import mock
from oslo_utils import versionutils as vutils
from unittest import mock

import fixtures
from oslo_utils import versionutils as vutils

from oslo_versionedobjects import base
from oslo_versionedobjects import fields



+ 1
- 1
oslo_versionedobjects/test.py View File

@@ -25,8 +25,8 @@ eventlet.monkey_patch(os=False) # noqa

import functools
import inspect
import mock
import os
from unittest import mock

import fixtures
from oslo_concurrency import lockutils


+ 1
- 3
oslo_versionedobjects/tests/test_exception.py View File

@@ -11,13 +11,11 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from unittest import mock

from oslo_versionedobjects import exception
from oslo_versionedobjects import test

import mock


notifier = mock.Mock()




+ 1
- 1
oslo_versionedobjects/tests/test_fields.py View File

@@ -14,10 +14,10 @@
# under the License.

import datetime
from unittest import mock
import warnings

import iso8601
import mock
import netaddr
import testtools



+ 1
- 1
oslo_versionedobjects/tests/test_fixture.py View File

@@ -17,9 +17,9 @@ import copy
import datetime
import hashlib
import inspect
from unittest import mock

import iso8601
import mock

from oslo_versionedobjects import base
from oslo_versionedobjects import exception


+ 1
- 1
oslo_versionedobjects/tests/test_objects.py View File

@@ -17,8 +17,8 @@ import datetime
import jsonschema
import logging
import pytz
from unittest import mock

import mock
from oslo_context import context
from oslo_serialization import jsonutils
from oslo_utils import timeutils


+ 0
- 1
test-requirements.txt View File

@@ -8,7 +8,6 @@ coverage!=4.4,>=4.0 # Apache-2.0
jsonschema>=2.6.0 # MIT
stestr>=2.0.0 # Apache-2.0

mock>=2.0.0 # BSD
fixtures>=3.0.0 # Apache-2.0/BSD

# Bandit security code scanner


Loading…
Cancel
Save