diff --git a/python-mocket-no-mock.patch b/python-mocket-no-mock.patch new file mode 100644 index 0000000..64a3111 --- /dev/null +++ b/python-mocket-no-mock.patch @@ -0,0 +1,12 @@ +diff -upr mocket-3.10.5.orig/tests/main/test_http.py mocket-3.10.5/tests/main/test_http.py +--- mocket-3.10.5.orig/tests/main/test_http.py 2022-05-17 15:23:49.159143686 +0200 ++++ mocket-3.10.5/tests/main/test_http.py 2022-05-17 15:23:49.163143712 +0200 +@@ -10,7 +10,7 @@ from urllib.error import HTTPError + from urllib.parse import urlencode + from urllib.request import urlopen + +-import mock ++from unittest import mock + import pytest + import requests + diff --git a/python-mocket.changes b/python-mocket.changes index 577fe6c..00fc691 100644 --- a/python-mocket.changes +++ b/python-mocket.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue May 17 13:29:27 UTC 2022 - pgajdos@suse.com + +- do not require python-mock for build +- added patches + fix https://github.com/mindflayer/python-mocket/issues/178 + + python-mocket-no-mock.patch + ------------------------------------------------------------------- Mon Apr 25 08:36:19 UTC 2022 - Sebastian Wagner diff --git a/python-mocket.spec b/python-mocket.spec index d4f5a08..1a9d403 100644 --- a/python-mocket.spec +++ b/python-mocket.spec @@ -35,6 +35,8 @@ URL: https://github.com/mindflayer/python-mocket Source0: https://files.pythonhosted.org/packages/source/m/mocket/mocket-%{version}.tar.gz # PATCH-FIX-OPENSUSE recording-urllib3-brotli.patch -- our urllib has different default headers than upstreams test reference, code@bnavigator.de Patch0: recording-urllib3-brotli.patch +# https://github.com/mindflayer/python-mocket/issues/178 +Patch1: python-mocket-no-mock.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -57,7 +59,6 @@ BuildRequires: %{python_module cryptography} BuildRequires: %{python_module decorator} BuildRequires: %{python_module gevent} BuildRequires: %{python_module http-parser >= 0.9.0} -BuildRequires: %{python_module mock} BuildRequires: %{python_module pook} BuildRequires: %{python_module pyOpenSSL} BuildRequires: %{python_module pytest} @@ -83,6 +84,7 @@ sed -i '/pipenv/ d' setup.py # urllib3 in TW accepts Brotli encoding by default %patch0 -p1 %endif +%patch1 -p1 %build %if !%{with test}