From 0f2cdc9456007dcf4f2c26c5d1d2fada6a1bf04ceb9c279719f0cdaaccd859a7 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sat, 12 Dec 2020 12:12:15 +0000 Subject: [PATCH] Accepting request 855336 from home:mcepl:branches:devel:tools:scm - Add remove_mock.patch to remove dependency on the external mock package (gh#gwik/geventhttpclient#135). OBS-URL: https://build.opensuse.org/request/show/855336 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-geventhttpclient?expand=0&rev=10 --- python-geventhttpclient.changes | 6 ++++++ python-geventhttpclient.spec | 6 ++++-- remove_mock.patch | 18 ++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 remove_mock.patch diff --git a/python-geventhttpclient.changes b/python-geventhttpclient.changes index 868080b..9e4b82a 100644 --- a/python-geventhttpclient.changes +++ b/python-geventhttpclient.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Dec 11 23:08:43 UTC 2020 - Matej Cepl + +- Add remove_mock.patch to remove dependency on the external mock + package (gh#gwik/geventhttpclient#135). + ------------------------------------------------------------------- Sat Aug 1 05:08:20 UTC 2020 - John Vandenberg diff --git a/python-geventhttpclient.spec b/python-geventhttpclient.spec index 777cbf0..b65c997 100644 --- a/python-geventhttpclient.spec +++ b/python-geventhttpclient.spec @@ -25,11 +25,13 @@ License: MIT Group: Development/Languages/Python URL: https://github.com/gwik/geventhttpclient Source: https://files.pythonhosted.org/packages/source/g/geventhttpclient/geventhttpclient-%{version}.tar.gz +# PATCH-FIX-UPSTREAM remove_mock.patch gh#gwik/geventhttpclient#135 mcepl@suse.com +# remove dependency on the external module mock +Patch0: remove_mock.patch BuildRequires: %{python_module certifi} BuildRequires: %{python_module devel} BuildRequires: %{python_module dpkt} BuildRequires: %{python_module gevent} -BuildRequires: %{python_module mock} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six} @@ -52,7 +54,7 @@ generally, it is designed for pulling from REST APIs and streaming APIs like Twitter's. %prep -%setup -q -n geventhttpclient-%{version} +%autosetup -p1 -n geventhttpclient-%{version} %build %python_build diff --git a/remove_mock.patch b/remove_mock.patch new file mode 100644 index 0000000..0bd7a87 --- /dev/null +++ b/remove_mock.patch @@ -0,0 +1,18 @@ +--- a/src/geventhttpclient/tests/test_ssl.py ++++ b/src/geventhttpclient/tests/test_ssl.py +@@ -1,5 +1,4 @@ +-import mock +-from mock import patch, Mock ++import unittest.mock as mock + + import dpkt.ssl + import six +@@ -117,7 +116,7 @@ def _get_sni_sent_from_client(**addition + ('127.0.0.1', server_port) + ) + with mock.patch( +- 'gevent.socket.getaddrinfo', Mock(return_value=[mock_addrinfo]) ++ 'gevent.socket.getaddrinfo', mock.Mock(return_value=[mock_addrinfo]) + ): + + server_host = 'some_foo'