Use unittest.mock instead of mock

The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead.

Bump horizon to 18.3.0 in lower-constraints.txt since it is the
first version with "Use unittest.mock instead of third party mock"
change [1]

[1] 7eeb9e14f9

Change-Id: Ic64fffaeded18ac11ce438c77526e60a37aeaa1d
This commit is contained in:
Hervé Beraud 2020-06-09 01:26:07 +02:00 committed by Martin Chacon Piza
parent 560c890dce
commit ca55abec23
8 changed files with 8 additions and 10 deletions

View File

@ -28,7 +28,7 @@ fixtures==3.0.0
funcsigs==1.0.0
futurist==1.2.0
greenlet==0.4.10
horizon==17.1.0
horizon==18.3.0
idna==2.6
imagesize==0.7.1
iso8601==0.1.11
@ -42,7 +42,6 @@ kombu==4.0.0
linecache2==1.0.0
MarkupSafe==1.0
mccabe==0.2.1
mock==2.0.0
monotonic==0.6
mox3==0.20.0
msgpack-python==0.4.0

View File

@ -14,7 +14,7 @@
# under the License.
from django.urls import reverse
from mock import patch
from unittest.mock import patch
from monitoring.alarmdefs import constants
from monitoring.alarmdefs import views

View File

@ -11,7 +11,7 @@
# under the License.
from django.urls import reverse
from mock import patch
from unittest.mock import patch
from monitoring.alarms import constants
from monitoring.alarms import tables

View File

@ -11,7 +11,7 @@
# under the License.
from django.urls import reverse
from mock import patch
from unittest.mock import patch
from monitoring.notifications import constants
from monitoring.test import helpers

View File

@ -16,8 +16,8 @@ import unittest
import warnings
from django.core.handlers import wsgi
import mock
from openstack_dashboard.test import helpers
from unittest import mock
from monitoring.test.test_data import utils as test_data_utils

View File

@ -14,7 +14,7 @@
from django.test import TestCase
from django.test.utils import override_settings
from mock import Mock
from unittest.mock import Mock
import monitoring.alarms.tables

View File

@ -16,8 +16,8 @@
from django.conf import settings as d_settings
from django.test.utils import override_settings
from mock import Mock
from mock import patch
from unittest.mock import Mock
from unittest.mock import patch
from monascaclient import client as mon_client
from monascaclient import v2_0

View File

@ -5,7 +5,6 @@
hacking>=3.0.1,<3.1.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
mock>=2.0.0 # BSD
nodeenv>=0.9.4 # BSD
selenium>=2.50.1 # Apache-2.0