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