Browse Source

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
changes/39/713039/2
Michael Johnson 1 year ago
parent
commit
c565e7b289
  1. 1
      lower-constraints.txt
  2. 3
      octavia_lib/tests/unit/api/drivers/test_driver_lib.py
  3. 3
      octavia_lib/tests/unit/base.py
  4. 1
      test-requirements.txt

1
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

3
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

3
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

1
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

Loading…
Cancel
Save