From 469b7d66b35356ce5ee468958d3c9e127cab1130 Mon Sep 17 00:00:00 2001 From: "wu.shiming" Date: Mon, 12 Oct 2020 17:14:22 +0800 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: Ie36f12a4a6dd3c06b9ffd9bfb7bbb0106311820f --- test-requirements.txt | 1 - tests/test_filesystem.py | 2 +- tests/test_inventory.py | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index c3ed8ab81b..6b1880ab04 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -6,7 +6,6 @@ hacking>=3.0.1,<3.1.0 # Apache-2.0 bashate>=0.5.1 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 -mock>=2.0.0 # BSD virtualenv>=14.0.6 # MIT # TODO(noonedeadpunk) Upgrade linters versions and drop pycodestyle # once we stop doing linters check for the integrated repo with diff --git a/tests/test_filesystem.py b/tests/test_filesystem.py index cddee77ff4..26c2696ac1 100644 --- a/tests/test_filesystem.py +++ b/tests/test_filesystem.py @@ -13,12 +13,12 @@ # under the License. # -import mock import os from os import path from osa_toolkit import filesystem as fs import sys import unittest +from unittest import mock from test_inventory import cleanup from test_inventory import get_inventory diff --git a/tests/test_inventory.py b/tests/test_inventory.py index 905abd8fae..5be4b6cf93 100644 --- a/tests/test_inventory.py +++ b/tests/test_inventory.py @@ -13,7 +13,6 @@ import collections import copy import json -import mock import os from os import path try: @@ -22,6 +21,7 @@ except ImportError: import queue as Queue import sys import unittest +from unittest import mock import warnings import yaml