From c565e7b2897514f3a7ab76018d8772c8e9ffe1c4 Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Fri, 13 Mar 2020 10:33:21 -0700 Subject: [PATCH] Remove the dependency on the "mock" package Now that we are python3 only, we should move to using the built in version of mock that supports all of our testing needs and remove the dependency on the "mock" package. This patch moves all references to "import mock" to "from unittest import mock". It also cleans up some new line inconsistency. Change-Id: Ie7567134a7c0ffae525d0282773e4c90a3f2d62b --- lower-constraints.txt | 1 - octavia_lib/tests/unit/api/drivers/test_driver_lib.py | 3 +-- octavia_lib/tests/unit/base.py | 3 +-- test-requirements.txt | 1 - 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lower-constraints.txt b/lower-constraints.txt index b6c825c..68fa740 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -2,7 +2,6 @@ bandit==1.4.0 coverage==4.0 doc8==0.6.0 hacking==0.12.0 -mock==2.0.0 oslo.i18n==3.15.3 oslo.serialization==2.28.1 oslo.utils==3.33.0 diff --git a/octavia_lib/tests/unit/api/drivers/test_driver_lib.py b/octavia_lib/tests/unit/api/drivers/test_driver_lib.py index fbaad3a..1afdc9b 100644 --- a/octavia_lib/tests/unit/api/drivers/test_driver_lib.py +++ b/octavia_lib/tests/unit/api/drivers/test_driver_lib.py @@ -11,8 +11,7 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. - -import mock +from unittest import mock from octavia_lib.api.drivers import driver_lib from octavia_lib.api.drivers import exceptions as driver_exceptions diff --git a/octavia_lib/tests/unit/base.py b/octavia_lib/tests/unit/base.py index bfaf504..13204a1 100644 --- a/octavia_lib/tests/unit/base.py +++ b/octavia_lib/tests/unit/base.py @@ -14,8 +14,7 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. - -import mock +from unittest import mock from oslotest import base diff --git a/test-requirements.txt b/test-requirements.txt index 56a501c..3ca6033 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,7 +7,6 @@ hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 bandit>=1.1.0 # Apache-2.0 coverage>=4.0,!=4.4 # Apache-2.0 doc8>=0.6.0 # Apache-2.0 -mock>=2.0.0 # BSD pylint==1.9.2 # GPLv2 python-subunit>=1.0.0 # Apache-2.0/BSD oslo.utils>=3.33.0 # Apache-2.0