Accepting request 640242 from devel:languages:python

- Upgrade to 3.4.4:
    - Multiple small bugfixes
- Remove remove-failing-tests-due-to-pytest-timeout-issues.patch
- Add invalid-escapes-in-tests.patch to fix invalid escapes in non-raw regexp strings.

OBS-URL: https://build.opensuse.org/request/show/640242
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-aiohttp?expand=0&rev=8
This commit is contained in:
Dominique Leuenberger 2018-10-08 15:45:38 +00:00 committed by Git OBS Bridge
commit 2d4c592738
6 changed files with 118 additions and 44 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9b15efa7411dcf3b59c1f4766eb16ba1aba4531a33e54d469ee22106eabce460
size 821067

3
aiohttp-3.4.4.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:51afec6ffa50a9da4cdef188971a802beb1ca8e8edb40fa429e5e529db3475fa
size 822110

View File

@ -0,0 +1,98 @@
--- a/tests/test_http_parser.py
+++ b/tests/test_http_parser.py
@@ -369,7 +369,7 @@ def test_max_header_field_size(parser, s
name = b't' * size
text = (b'GET /test HTTP/1.1\r\n' + name + b':data\r\n\r\n')
- match = ("400, message='Got more than 8190 bytes \({}\) when reading"
+ match = (r"400, message='Got more than 8190 bytes \({}\) when reading"
.format(size))
with pytest.raises(http_exceptions.LineTooLong, match=match):
parser.feed_data(text)
@@ -399,7 +399,7 @@ def test_max_header_value_size(parser, s
text = (b'GET /test HTTP/1.1\r\n'
b'data:' + name + b'\r\n\r\n')
- match = ("400, message='Got more than 8190 bytes \({}\) when reading"
+ match = (r"400, message='Got more than 8190 bytes \({}\) when reading"
.format(size))
with pytest.raises(http_exceptions.LineTooLong, match=match):
parser.feed_data(text)
@@ -430,7 +430,7 @@ def test_max_header_value_size_continuat
text = (b'GET /test HTTP/1.1\r\n'
b'data: test\r\n ' + name + b'\r\n\r\n')
- match = ("400, message='Got more than 8190 bytes \({}\) when reading"
+ match = (r"400, message='Got more than 8190 bytes \({}\) when reading"
.format(size))
with pytest.raises(http_exceptions.LineTooLong, match=match):
parser.feed_data(text)
@@ -551,7 +551,7 @@ def test_http_request_parser_bad_version
@pytest.mark.parametrize('size', [40965, 8191])
def test_http_request_max_status_line(parser, size):
path = b't' * (size - 5)
- match = ("400, message='Got more than 8190 bytes \({}\) when reading"
+ match = (r"400, message='Got more than 8190 bytes \({}\) when reading"
.format(size))
with pytest.raises(http_exceptions.LineTooLong, match=match):
parser.feed_data(
@@ -595,7 +595,7 @@ def test_http_response_parser_utf8(respo
@pytest.mark.parametrize('size', [40962, 8191])
def test_http_response_parser_bad_status_line_too_long(response, size):
reason = b't' * (size - 2)
- match = ("400, message='Got more than 8190 bytes \({}\) when reading"
+ match = (r"400, message='Got more than 8190 bytes \({}\) when reading"
.format(size))
with pytest.raises(http_exceptions.LineTooLong, match=match):
response.feed_data(
--- a/tests/test_streams.py
+++ b/tests/test_streams.py
@@ -721,7 +721,7 @@ class TestStreamReader:
async def test___repr__waiter(self, loop):
stream = self._make_one()
stream._waiter = loop.create_future()
- assert re.search("<StreamReader w=<Future pending[\S ]*>>",
+ assert re.search(r"<StreamReader w=<Future pending[\S ]*>>",
repr(stream))
stream._waiter.set_result(None)
await stream._waiter
--- a/tests/test_urldispatch.py
+++ b/tests/test_urldispatch.py
@@ -586,7 +586,7 @@ def test_add_route_with_invalid_re(route
def test_route_dynamic_with_regex_spec(router):
handler = make_handler()
- route = router.add_route('GET', '/get/{num:^\d+}', handler,
+ route = router.add_route('GET', r'/get/{num:^\d+}', handler,
name='name')
url = route.url_for(num='123')
@@ -595,7 +595,7 @@ def test_route_dynamic_with_regex_spec(r
def test_route_dynamic_with_regex_spec_and_trailing_slash(router):
handler = make_handler()
- route = router.add_route('GET', '/get/{num:^\d+}/', handler,
+ route = router.add_route('GET', r'/get/{num:^\d+}/', handler,
name='name')
url = route.url_for(num='123')
@@ -1125,7 +1125,7 @@ def test_plain_resource_canonical():
def test_dynamic_resource_canonical():
canonicals = {
'/get/{name}': '/get/{name}',
- '/get/{num:^\d+}': '/get/{num}',
+ r'/get/{num:^\d+}': '/get/{num}',
r'/handler/{to:\d+}': r'/handler/{to}',
r'/{one}/{two:.+}': r'/{one}/{two}',
}
--- a/tests/test_web_request.py
+++ b/tests/test_web_request.py
@@ -340,7 +340,7 @@ def test_single_forwarded_header_multipl
def test_single_forwarded_header_quoted_escaped():
- header = 'BY=identifier;pROTO="\lala lan\d\~ 123\!&"'
+ header = r'BY=identifier;pROTO="\lala lan\d\~ 123\!&"'
req = make_mocked_request('GET', '/',
headers=CIMultiDict({'Forwarded': header}))
assert req.forwarded[0]['by'] == 'identifier'

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Sat Oct 6 11:10:41 CEST 2018 - mcepl@suse.com
- Upgrade to 3.4.4:
- Multiple small bugfixes
- Remove remove-failing-tests-due-to-pytest-timeout-issues.patch
- Add invalid-escapes-in-tests.patch to fix invalid escapes in
non-raw regexp strings.
-------------------------------------------------------------------
Fri Aug 31 11:50:26 UTC 2018 - Tomáš Chvátal <tchvatal@suse.com>

View File

@ -12,23 +12,24 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python3-%{**}}
%define skip_python2 1
Name: python-aiohttp
Version: 3.4.0
Version: 3.4.4
Release: 0
Summary: Asynchronous HTTP client/server framework
License: Apache-2.0
Group: Development/Languages/Python
URL: https://github.com/aio-libs/aiohttp
Source: https://files.pythonhosted.org/packages/source/a/aiohttp/aiohttp-%{version}.tar.gz
# PATCH-FIX-OPENSUSE alarrosa@suse.com -- Fix failing tests due to issue in pytest-timeout
Patch0: remove-failing-tests-due-to-pytest-timeout-issues.patch
BuildRequires: %{python_module Cython >= 0.28.4}
# PATCH-FIX-UPSTREAM mcepl@suse.com -- Fix failing tests due to invalid escapes in regexps
# https://github.com/aio-libs/aiohttp/issues/3325
Patch0: invalid-escapes-in-tests.patch
BuildRequires: %{python_module Cython >= 0.28.4}
BuildRequires: %{python_module devel >= 3.5.3}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
@ -88,7 +89,7 @@ HTML documentation on the API and examples for %{name}.
%prep
%setup -q -n aiohttp-%{version}
%patch0 -p1
%autopatch -p1
%build
export CFLAGS="%{optflags}"

View File

@ -1,35 +0,0 @@
From: Antonio Larrosa <alarrosa@suse.com>
Remove failing test due to a DeprecationWarning being issued
by pytest because pytest-timeout is using a wrong parameter
when calling addoption.
I tested changing pytest-timeout from using type='choice' to
type=str and that passed the tests, so I choosed to remove the
test while the fix gets to the python-pytest-timeout package.
Index: aiohttp-3.0.1/tests/test_test_utils.py
===================================================================
--- aiohttp-3.0.1.orig/tests/test_test_utils.py
+++ aiohttp-3.0.1/tests/test_test_utils.py
@@ -243,20 +243,6 @@ async def test_server_make_url_yarl_comp
make_url(URL('http://foo.com'))
-def test_testcase_no_app(testdir, loop):
- testdir.makepyfile(
- """
- from aiohttp.test_utils import AioHTTPTestCase
-
-
- class InvalidTestCase(AioHTTPTestCase):
- def test_noop(self):
- pass
- """)
- result = testdir.runpytest()
- result.stdout.fnmatch_lines(["*RuntimeError*"])
-
-
async def test_server_context_manager(app, loop):
async with _TestServer(app, loop=loop) as server:
async with aiohttp.ClientSession(loop=loop) as client: