Use unittest.mock instead of PyPI mock
Now that py2 is gone, oslotest dropped dependency on mock and will soon affect Ussuri CI [1], let's use unittest.mock built in py3. This also fixes py38 jobs and proactively prevents py36 and py37 failing due to [1]. This is because we never included mock in test-requirements (but in lower-constraints where it does not really belong at all) and instead relied on oslotest to bring it in. [1] https://review.opendev.org/716322 Change-Id: I30e82e2d87418272a71c7ee089a8acdaf8872158
This commit is contained in:
parent
47e2baf9f4
commit
5648ad6e9d
@ -13,9 +13,9 @@
|
||||
# under the License.
|
||||
|
||||
import unittest
|
||||
from unittest import mock
|
||||
|
||||
import jinja2
|
||||
import mock
|
||||
|
||||
from kolla_ansible import exception
|
||||
from kolla_ansible import filters
|
||||
|
@ -39,7 +39,6 @@ keystoneauth1==3.4.0
|
||||
linecache2==1.0.0
|
||||
MarkupSafe==1.0
|
||||
mccabe==0.2.1
|
||||
mock==2.0.0
|
||||
monotonic==1.4
|
||||
mox3==0.25.0
|
||||
msgpack==0.5.6
|
||||
|
@ -19,11 +19,8 @@ import copy
|
||||
import imp
|
||||
import os
|
||||
import sys
|
||||
|
||||
try:
|
||||
from unittest import mock
|
||||
except ImportError:
|
||||
import mock
|
||||
|
||||
from docker import errors as docker_error
|
||||
from docker.types import Ulimit
|
||||
from oslotest import base
|
||||
|
@ -16,9 +16,9 @@
|
||||
import imp
|
||||
import os
|
||||
import sys
|
||||
from unittest import mock
|
||||
|
||||
from io import StringIO
|
||||
import mock
|
||||
from oslotest import base
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user