From bd05a5217c2dc66ce6cd077a4f5f1dc4cec128895a0ea7618eac69a3e23146e2 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Fri, 22 Jul 2022 11:15:57 +0000 Subject: [PATCH] - Add patch remove-mock.patch: * Use unittest.mock if available. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-requests-mock?expand=0&rev=47 --- python-requests-mock.changes | 6 ++++++ python-requests-mock.spec | 7 +++---- remove-mock.patch | 16 ++++++++++++++++ 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 remove-mock.patch diff --git a/python-requests-mock.changes b/python-requests-mock.changes index d854d5f..f448776 100644 --- a/python-requests-mock.changes +++ b/python-requests-mock.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Jul 22 11:15:27 UTC 2022 - Steve Kowalik + +- Add patch remove-mock.patch: + * Use unittest.mock if available. + ------------------------------------------------------------------- Sun Jun 6 11:58:05 UTC 2021 - Dirk Müller diff --git a/python-requests-mock.spec b/python-requests-mock.spec index 1a3e2c7..8104ef8 100644 --- a/python-requests-mock.spec +++ b/python-requests-mock.spec @@ -1,7 +1,7 @@ # # spec file for package python-requests-mock # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -22,11 +22,10 @@ Version: 1.9.3 Release: 0 Summary: Module to mock out responses from the requests package License: Apache-2.0 -Group: Development/Languages/Python URL: https://github.com/jamielennox/requests-mock Source: https://files.pythonhosted.org/packages/source/r/requests-mock/requests-mock-%{version}.tar.gz +Patch0: remove-mock.patch BuildRequires: %{python_module fixtures} -BuildRequires: %{python_module mock} BuildRequires: %{python_module pbr} BuildRequires: %{python_module purl} BuildRequires: %{python_module purl} @@ -55,7 +54,7 @@ requests-mock provides a building block to stub out the HTTP requests portions o You should checkout the docs for more information. %prep -%setup -q -n requests-mock-%{version} +%autosetup -p1 -n requests-mock-%{version} %build %python_build diff --git a/remove-mock.patch b/remove-mock.patch new file mode 100644 index 0000000..5a3ef7f --- /dev/null +++ b/remove-mock.patch @@ -0,0 +1,16 @@ +Index: requests-mock-1.9.3/tests/test_mocker.py +=================================================================== +--- requests-mock-1.9.3.orig/tests/test_mocker.py ++++ requests-mock-1.9.3/tests/test_mocker.py +@@ -12,7 +12,10 @@ + + import pickle + +-import mock ++try: ++ from unittest import mock ++except ImportError: ++ import mock + import requests + + import requests_mock