diff options
author | Ben Greiner <code@bnavigator.de> | 2020-12-19 17:07:07 +0100 |
---|---|---|
committer | Daniel Bengtsson <dbengt@redhat.com> | 2022-01-21 10:44:41 +0100 |
commit | 397b6fcdf953f7483805ff1501ec7f847fa372f3 (patch) | |
tree | 01c9145a70aed11a5f007fe967bf6bde2837138e | |
parent | c718425299af4f4df7b32adb90e8d183e101c6bc (diff) | |
download | pbr-397b6fcdf953f7483805ff1501ec7f847fa372f3.tar.gz |
remove explicit mock
The explicit mock package is not required if you can use unittest.mock
from python >= 3.3
Change-Id: I1e3a764b38be66b994d790768bc5eb9be4237444
-rw-r--r-- | pbr/tests/test_packaging.py | 5 | ||||
-rw-r--r-- | pbr/tests/test_pbr_json.py | 5 | ||||
-rw-r--r-- | test-requirements.txt | 1 |
3 files changed, 8 insertions, 3 deletions
diff --git a/pbr/tests/test_packaging.py b/pbr/tests/test_packaging.py index 7735053..236c5e1 100644 --- a/pbr/tests/test_packaging.py +++ b/pbr/tests/test_packaging.py @@ -48,7 +48,10 @@ import tempfile import textwrap import fixtures -import mock +try: + from unittest import mock +except ImportError: + import mock import pkg_resources import six import testscenarios diff --git a/pbr/tests/test_pbr_json.py b/pbr/tests/test_pbr_json.py index f066971..eb9a08a 100644 --- a/pbr/tests/test_pbr_json.py +++ b/pbr/tests/test_pbr_json.py @@ -10,7 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +try: + from unittest import mock +except ImportError: + import mock from pbr import pbr_json from pbr.tests import base diff --git a/test-requirements.txt b/test-requirements.txt index 4d586e4..3af261d 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -6,7 +6,6 @@ wheel>=0.32.0 # MIT fixtures>=3.0.0 # Apache-2.0/BSD hacking>=1.1.0,<4.0.0;python_version>='3.6' # Apache-2.0 mock>=2.0.0,<4.0.0;python_version=='2.7' # BSD -mock>=2.0.0;python_version>='3.6' # BSD six>=1.12.0 # MIT stestr>=2.1.0,<3.0;python_version=='2.7' # Apache-2.0 stestr>=2.1.0;python_version>='3.0' # Apache-2.0 |