From a0f41eea5313ab10256ecce78a063b3191b13ad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Beraud?= Date: Tue, 9 Jun 2020 12:10:32 +0200 Subject: [PATCH] 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. Change-Id: Ib8c30a3357c57f9c127b94d777610d602454e0ef --- lower-constraints.txt | 1 - sahara_plugin_storm/tests/unit/base.py | 3 ++- sahara_plugin_storm/tests/unit/plugins/storm/test_plugin.py | 2 +- test-requirements.txt | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lower-constraints.txt b/lower-constraints.txt index adc125d..97500de 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -57,7 +57,6 @@ Mako==1.0.7 MarkupSafe==1.1.0 mccabe==0.5.3 microversion-parse==0.2.1 -mock==2.0.0 monotonic==1.5 mox3==0.26.0 msgpack==0.6.1 diff --git a/sahara_plugin_storm/tests/unit/base.py b/sahara_plugin_storm/tests/unit/base.py index 962f220..7954d0d 100644 --- a/sahara_plugin_storm/tests/unit/base.py +++ b/sahara_plugin_storm/tests/unit/base.py @@ -13,7 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +from unittest import mock + from oslotest import base from sahara import context diff --git a/sahara_plugin_storm/tests/unit/plugins/storm/test_plugin.py b/sahara_plugin_storm/tests/unit/plugins/storm/test_plugin.py index 10a55c2..d45809a 100644 --- a/sahara_plugin_storm/tests/unit/plugins/storm/test_plugin.py +++ b/sahara_plugin_storm/tests/unit/plugins/storm/test_plugin.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +from unittest import mock from sahara.plugins import base as pb from sahara.plugins import conductor diff --git a/test-requirements.txt b/test-requirements.txt index 9b3eb86..f3621b2 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -9,7 +9,6 @@ bashate>=0.5.1 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 doc8>=0.6.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD -mock>=2.0.0 # BSD oslotest>=3.2.0 # Apache-2.0 stestr>=1.0.0 # Apache-2.0 pylint==1.4.5 # GPLv2