14
0

- Add patch to build with latest httplib2 releases:

* httplib2.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-wsgi_intercept?expand=0&rev=44
This commit is contained in:
Tomáš Chvátal
2019-10-15 11:20:46 +00:00
committed by Git OBS Bridge
parent 38d6553cc6
commit 061bc67d87
3 changed files with 94 additions and 1 deletions

86
httplib2.patch Normal file
View File

@@ -0,0 +1,86 @@
From c4d44f5712e85d302db7e80e16156ca9c501bb6b Mon Sep 17 00:00:00 2001
From: Chris Dent <cdent@anticdent.org>
Date: Tue, 15 Oct 2019 12:10:10 +0100
Subject: [PATCH] Updates for dependent library changes
httplib2 added some more kwargs, so rather than continuing
to explicitly list each one (they are ignored), use **kwargs
instead.
update some tests to work correctly with modern pytest, which
no longer allows the string-as-callable to check for exceptions.
Use py.test.raises context manager instead.
remove python versions that tox no longer supports
---
wsgi_intercept/httplib2_intercept.py | 3 +--
wsgi_intercept/tests/test_httplib2.py | 7 +++----
wsgi_intercept/tests/test_requests.py | 5 ++---
wsgi_intercept/tests/test_urllib3.py | 6 ++----
5 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/wsgi_intercept/httplib2_intercept.py b/wsgi_intercept/httplib2_intercept.py
index 1edbfbd..ae92a9d 100644
--- a/wsgi_intercept/httplib2_intercept.py
+++ b/wsgi_intercept/httplib2_intercept.py
@@ -32,8 +32,7 @@ class HTTPS_WSGIInterceptorWithTimeout(HTTPSInterceptorMixin,
HTTPSConnectionWithTimeout):
def __init__(self, host, port=None, strict=None, timeout=None,
proxy_info=None, ca_certs=None, source_address=None,
- disable_ssl_certificate_validation=False,
- ssl_version=None):
+ **kwargs):
# ignore proxy_info and ca_certs
# In Python3 strict is deprecated
diff --git a/wsgi_intercept/tests/test_httplib2.py b/wsgi_intercept/tests/test_httplib2.py
index 160cce4..0f1e177 100644
--- a/wsgi_intercept/tests/test_httplib2.py
+++ b/wsgi_intercept/tests/test_httplib2.py
@@ -42,10 +42,9 @@ def test_http_other_port():
def test_bogus_domain():
with InstalledApp(wsgi_app.simple_app, host=HOST, port=80):
- py.test.raises(
- gaierror,
- 'httplib2_intercept.HTTP_WSGIInterceptorWithTimeout('
- '"_nonexistant_domain_").connect()')
+ with py.test.raises(gaierror):
+ httplib2_intercept.HTTP_WSGIInterceptorWithTimeout(
+ "_nonexistant_domain_").connect()
def test_proxy_handling():
diff --git a/wsgi_intercept/tests/test_requests.py b/wsgi_intercept/tests/test_requests.py
index 8c09a37..4d69ba9 100644
--- a/wsgi_intercept/tests/test_requests.py
+++ b/wsgi_intercept/tests/test_requests.py
@@ -36,9 +36,8 @@ def test_http_other_port():
def test_bogus_domain():
with InstalledApp(wsgi_app.simple_app, host=HOST, port=80):
- py.test.raises(
- ConnectionError,
- 'requests.get("http://_nonexistant_domain_")')
+ with py.test.raises(ConnectionError):
+ requests.get("http://_nonexistant_domain_")
def test_proxy_handling():
diff --git a/wsgi_intercept/tests/test_urllib3.py b/wsgi_intercept/tests/test_urllib3.py
index 021b614..229a309 100644
--- a/wsgi_intercept/tests/test_urllib3.py
+++ b/wsgi_intercept/tests/test_urllib3.py
@@ -38,10 +38,8 @@ def test_http_other_port():
def test_bogus_domain():
with InstalledApp(wsgi_app.simple_app, host=HOST, port=80):
- py.test.raises(
- urllib3.exceptions.ProtocolError,
- 'http.request("GET", "http://_nonexistant_domain_", '
- 'retries=False)')
+ with py.test.raises(urllib3.exceptions.ProtocolError):
+ http.request("GET", "http://_nonexistant_domain_", retries=False)
def test_proxy_handling():

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Oct 15 11:19:10 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Add patch to build with latest httplib2 releases:
* httplib2.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Tue May 28 06:48:33 UTC 2019 - Jan Engelhardt <jengelh@inai.de> Tue May 28 06:48:33 UTC 2019 - Jan Engelhardt <jengelh@inai.de>

View File

@@ -22,9 +22,9 @@ Version: 1.8.1
Release: 0 Release: 0
Summary: Library for installing a WSGI application in place of a real URI for testing Summary: Library for installing a WSGI application in place of a real URI for testing
License: MIT License: MIT
Group: Development/Languages/Python
URL: https://github.com/cdent/python3-wsgi-intercept URL: https://github.com/cdent/python3-wsgi-intercept
Source: https://files.pythonhosted.org/packages/source/w/wsgi_intercept/wsgi_intercept-%{version}.tar.gz Source: https://files.pythonhosted.org/packages/source/w/wsgi_intercept/wsgi_intercept-%{version}.tar.gz
Patch0: httplib2.patch
BuildRequires: %{python_module devel} BuildRequires: %{python_module devel}
BuildRequires: %{python_module httplib2} BuildRequires: %{python_module httplib2}
BuildRequires: %{python_module pytest >= 2.4} BuildRequires: %{python_module pytest >= 2.4}
@@ -52,6 +52,7 @@ can avoid spawning multiple processes or threads to test your Web app.
%prep %prep
%setup -q -n wsgi_intercept-%{version} %setup -q -n wsgi_intercept-%{version}
%patch0 -p1
%build %build
%python_build %python_build