Hello community,
here is the log from the commit of package python-aioresponses for
openSUSE:Factory checked in at 2020-01-17 16:08:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-aioresponses (Old)
and /work/SRC/openSUSE:Factory/.python-aioresponses.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-aioresponses"
Fri Jan 17 16:08:22 2020 rev:6 rq:765075 version:0.6.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-aioresponses/python-aioresponses.changes
2019-10-09 15:20:34.592325189 +0200
+++
/work/SRC/openSUSE:Factory/.python-aioresponses.new.26092/python-aioresponses.changes
2020-01-17 16:08:33.100529868 +0100
@@ -1,0 +2,9 @@
+Thu Jan 16 16:49:49 UTC 2020 - Marketa Calabkova <[email protected]>
+
+- update to 0.6.2
+ * Save every received request. Even when no response is subscribed.
+ * Ensure that a copy of kwargs is stored in request
+ * remove overly verbose Exception
+ * assert the correct ClientConnectionError
+
+-------------------------------------------------------------------
Old:
----
aioresponses-0.6.1.tar.gz
New:
----
aioresponses-0.6.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-aioresponses.spec ++++++
--- /var/tmp/diff_new_pack.6IKwqt/_old 2020-01-17 16:08:33.660530132 +0100
+++ /var/tmp/diff_new_pack.6IKwqt/_new 2020-01-17 16:08:33.672530138 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-aioresponses
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python3-%{**}}
%define skip_python2 1
Name: python-aioresponses
-Version: 0.6.1
+Version: 0.6.2
Release: 0
Summary: Python module for mocking out requests made by ClientSession
from aiohttp
License: MIT
++++++ aioresponses-0.6.1.tar.gz -> aioresponses-0.6.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aioresponses-0.6.1/.travis.yml
new/aioresponses-0.6.2/.travis.yml
--- old/aioresponses-0.6.1/.travis.yml 2019-10-01 23:32:40.000000000 +0200
+++ new/aioresponses-0.6.2/.travis.yml 2019-11-21 23:22:36.000000000 +0100
@@ -25,6 +25,8 @@
env: TOXENV=py35-aiohttp34
- python: 3.5
env: TOXENV=py35-aiohttp35
+ - python: 3.5
+ env: TOXENV=py35-aiohttp36
- python: 3.6
env: TOXENV=py36-aiohttp20
@@ -46,6 +48,8 @@
env: TOXENV=py36-aiohttp34
- python: 3.6
env: TOXENV=py36-aiohttp35
+ - python: 3.6
+ env: TOXENV=py36-aiohttp36
- python: 3.7
dist: xenial
@@ -56,6 +60,9 @@
- python: 3.7
dist: xenial
env: TOXENV=py37-aiohttp35
+ - python: 3.7
+ dist: xenial
+ env: TOXENV=py37-aiohttp36
# - python: 3.7
# dist: xenial
# env: TOXENV=py36-aiohttp-master
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aioresponses-0.6.1/AUTHORS
new/aioresponses-0.6.2/AUTHORS
--- old/aioresponses-0.6.1/AUTHORS 2019-10-02 00:02:39.000000000 +0200
+++ new/aioresponses-0.6.2/AUTHORS 2020-01-09 19:10:35.000000000 +0100
@@ -6,6 +6,7 @@
Anthony Lukach <[email protected]>
Brett Wandel <[email protected]>
Bryce Drennan <[email protected]>
+Colin-b <[email protected]>
Daniel Hahler <[email protected]>
Ilaï Deutel <[email protected]>
Joongi Kim <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aioresponses-0.6.1/CONTRIBUTING.rst
new/aioresponses-0.6.2/CONTRIBUTING.rst
--- old/aioresponses-0.6.1/CONTRIBUTING.rst 2018-02-17 01:45:28.000000000
+0100
+++ new/aioresponses-0.6.2/CONTRIBUTING.rst 2019-11-21 23:22:36.000000000
+0100
@@ -101,7 +101,7 @@
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
-3. The pull request should work for Python 2.6, 2.7, 3.3, 3.4 and 3.5, and for
PyPy. Check
+3. The pull request should work for Python 3.5, 3.6, 3.7 and for PyPy. Check
https://travis-ci.org/pnuckowski/aioresponses/pull_requests
and make sure that the tests pass for all supported Python versions.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aioresponses-0.6.1/ChangeLog
new/aioresponses-0.6.2/ChangeLog
--- old/aioresponses-0.6.1/ChangeLog 2019-10-02 00:02:39.000000000 +0200
+++ new/aioresponses-0.6.2/ChangeLog 2020-01-09 19:10:35.000000000 +0100
@@ -1,6 +1,15 @@
CHANGES
=======
+0.6.2
+-----
+
+* Ensure that a copy of kwargs is stored in request to prevent further
modifications to update saved request
+* drop some deps and refactor test
+* fix tests
+* Send a RuntimeError indicating that session is closed, the same way as
aiohttp does
+* Save every received request. Even when no response is subscribed
+
0.6.1
-----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aioresponses-0.6.1/PKG-INFO
new/aioresponses-0.6.2/PKG-INFO
--- old/aioresponses-0.6.1/PKG-INFO 2019-10-02 00:02:41.000000000 +0200
+++ new/aioresponses-0.6.2/PKG-INFO 2020-01-09 19:10:50.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: aioresponses
-Version: 0.6.1
+Version: 0.6.2
Summary: Mock out requests made by ClientSession from aiohttp package
Home-page: https://github.com/pnuckowski/aioresponses
Author: Pawel Nuckowski
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aioresponses-0.6.1/aioresponses/core.py
new/aioresponses-0.6.2/aioresponses/core.py
--- old/aioresponses-0.6.1/aioresponses/core.py 2019-10-01 23:32:40.000000000
+0200
+++ new/aioresponses-0.6.2/aioresponses/core.py 2020-01-09 19:07:56.000000000
+0100
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import asyncio
import json
+import copy
from collections import namedtuple
from distutils.version import StrictVersion
from functools import wraps
@@ -319,6 +320,9 @@
*args: Tuple,
**kwargs: Dict) -> 'ClientResponse':
"""Return mocked response object or raise connection error."""
+ if orig_self.closed:
+ raise RuntimeError('Session is closed')
+
url = normalize_url(merge_params(url, kwargs.get('params')))
url_str = str(url)
for prefix in self._passthrough:
@@ -328,14 +332,16 @@
))
response = await self.match(method, url, **kwargs)
+
+ key = (method, url)
+ self.requests.setdefault(key, [])
+ self.requests[key].append(RequestCall(args, copy.deepcopy(kwargs)))
+
if response is None:
raise ClientConnectionError(
'Connection refused: {} {}'.format(method, url)
)
self._responses.append(response)
- key = (method, url)
- self.requests.setdefault(key, [])
- self.requests[key].append(RequestCall(args, kwargs))
# Automatically call response.raise_for_status() on a request if the
# request was initialized with raise_for_status=True. Also call
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aioresponses-0.6.1/aioresponses.egg-info/PKG-INFO
new/aioresponses-0.6.2/aioresponses.egg-info/PKG-INFO
--- old/aioresponses-0.6.1/aioresponses.egg-info/PKG-INFO 2019-10-02
00:02:39.000000000 +0200
+++ new/aioresponses-0.6.2/aioresponses.egg-info/PKG-INFO 2020-01-09
19:10:35.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: aioresponses
-Version: 0.6.1
+Version: 0.6.2
Summary: Mock out requests made by ClientSession from aiohttp package
Home-page: https://github.com/pnuckowski/aioresponses
Author: Pawel Nuckowski
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aioresponses-0.6.1/aioresponses.egg-info/SOURCES.txt
new/aioresponses-0.6.2/aioresponses.egg-info/SOURCES.txt
--- old/aioresponses-0.6.1/aioresponses.egg-info/SOURCES.txt 2019-10-02
00:02:40.000000000 +0200
+++ new/aioresponses-0.6.2/aioresponses.egg-info/SOURCES.txt 2020-01-09
19:10:50.000000000 +0100
@@ -42,4 +42,6 @@
docs/usage.rst
tests/__init__.py
tests/test_aioresponses.py
-tests/test_compat.py
\ No newline at end of file
+tests/test_compat.py
+tests/test_compat_pytest.py
+tests/test_pytest.py
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aioresponses-0.6.1/aioresponses.egg-info/pbr.json
new/aioresponses-0.6.2/aioresponses.egg-info/pbr.json
--- old/aioresponses-0.6.1/aioresponses.egg-info/pbr.json 2019-10-02
00:02:39.000000000 +0200
+++ new/aioresponses-0.6.2/aioresponses.egg-info/pbr.json 2020-01-09
19:10:35.000000000 +0100
@@ -1 +1 @@
-{"git_version": "80368be", "is_release": false}
\ No newline at end of file
+{"git_version": "382b1a4", "is_release": false}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aioresponses-0.6.1/requirements-dev.txt
new/aioresponses-0.6.2/requirements-dev.txt
--- old/aioresponses-0.6.1/requirements-dev.txt 2018-09-23 22:47:52.000000000
+0200
+++ new/aioresponses-0.6.2/requirements-dev.txt 2019-11-22 08:35:35.000000000
+0100
@@ -1,6 +1,5 @@
pip
wheel
-watchdog==0.9.0
flake8==3.5.0
tox==3.4.0
coverage==4.5.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aioresponses-0.6.1/tests/test_aioresponses.py
new/aioresponses-0.6.2/tests/test_aioresponses.py
--- old/aioresponses-0.6.1/tests/test_aioresponses.py 2019-10-01
23:32:40.000000000 +0200
+++ new/aioresponses-0.6.2/tests/test_aioresponses.py 2020-01-09
19:07:56.000000000 +0100
@@ -102,7 +102,7 @@
headers={'Connection': 'keep-alive'})
response = yield from self.session.get(self.url)
expected_raw_headers = (
- (b'Content-Type', b'text/html'),
+ (hdrs.CONTENT_TYPE.encode(), b'text/html'),
(b'Connection', b'keep-alive')
)
@@ -231,25 +231,68 @@
@asyncio.coroutine
def test_multiple_requests(self):
+ """Ensure that requests are saved the way they would have been sent."""
with aioresponses() as m:
m.get(self.url, status=200)
m.get(self.url, status=201)
m.get(self.url, status=202)
- resp = yield from self.session.get(self.url)
+ json_content_as_ref = [1]
+ resp = yield from self.session.get(self.url,
json=json_content_as_ref)
self.assertEqual(resp.status, 200)
- resp = yield from self.session.get(self.url)
+ json_content_as_ref[:] = [2]
+ resp = yield from self.session.get(self.url,
json=json_content_as_ref)
self.assertEqual(resp.status, 201)
- resp = yield from self.session.get(self.url)
+ json_content_as_ref[:] = [3]
+ resp = yield from self.session.get(self.url,
json=json_content_as_ref)
self.assertEqual(resp.status, 202)
key = ('GET', URL(self.url))
self.assertIn(key, m.requests)
self.assertEqual(len(m.requests[key]), 3)
+
+ first_request = m.requests[key][0]
+ self.assertEqual(first_request.args, tuple())
+ self.assertEqual(first_request.kwargs,
+ {'allow_redirects': True, "json": [1]})
+
+ second_request = m.requests[key][1]
+ self.assertEqual(second_request.args, tuple())
+ self.assertEqual(second_request.kwargs,
+ {'allow_redirects': True, "json": [2]})
+
+ third_request = m.requests[key][2]
+ self.assertEqual(third_request.args, tuple())
+ self.assertEqual(third_request.kwargs,
+ {'allow_redirects': True, "json": [3]})
+
+ @asyncio.coroutine
+ def test_request_retrieval_in_case_no_response(self):
+ with aioresponses() as m:
+ with self.assertRaises(ClientConnectionError):
+ yield from self.session.get(self.url)
+
+ key = ('GET', URL(self.url))
+ self.assertIn(key, m.requests)
+ self.assertEqual(len(m.requests[key]), 1)
self.assertEqual(m.requests[key][0].args, tuple())
self.assertEqual(m.requests[key][0].kwargs,
{'allow_redirects': True})
@asyncio.coroutine
+ def test_request_failure_in_case_session_is_closed(self):
+ @asyncio.coroutine
+ def do_request(session):
+ return (yield from session.get(self.url))
+
+ with aioresponses():
+ coro = do_request(self.session)
+ yield from self.session.close()
+
+ with self.assertRaises(RuntimeError) as exception_info:
+ yield from coro
+ assert str(exception_info.exception) == "Session is closed"
+
+ @asyncio.coroutine
def test_address_as_instance_of_url_combined_with_pass_through(self):
external_api = 'http://httpbin.org/status/201'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aioresponses-0.6.1/tests/test_compat_pytest.py
new/aioresponses-0.6.2/tests/test_compat_pytest.py
--- old/aioresponses-0.6.1/tests/test_compat_pytest.py 1970-01-01
01:00:00.000000000 +0100
+++ new/aioresponses-0.6.2/tests/test_compat_pytest.py 2019-11-21
21:08:22.000000000 +0100
@@ -0,0 +1,42 @@
+# # -*- coding: utf-8 -*-
+# from typing import Union
+#
+# import pytest
+# from yarl import URL
+#
+# from aioresponses.compat import merge_params
+#
+#
+# @pytest.fixture
+# def url_with_parameters():
+# return 'http://example.com/api?foo=bar#fragment'
+#
+#
+# @pytest.fixture
+# def url_without_parameters():
+# return 'http://example.com/api?#fragment'
+#
+#
+# def get_url(url: str, as_str: bool) -> Union[URL, str]:
+# return url if as_str else URL(url)
+#
+#
+# @pytest.mark.parametrize("as_str", (True, False))
+# def test_no_params_returns_same_url__as_str(as_str, url_with_parameters):
+# url = get_url(url_with_parameters, as_str)
+# assert merge_params(url, None) == URL(url_with_parameters)
+#
+#
+# @pytest.mark.parametrize("as_str", (True, False))
+# def test_empty_params_returns_same_url__as_str(as_str, url_with_parameters):
+# url = get_url(url_with_parameters, as_str)
+# assert merge_params(url, {}) == URL(url_with_parameters)
+#
+#
+# @pytest.mark.parametrize("as_str", (True, False))
+# def test_both_with_params_returns_corrected_url__as_str(as_str,
+# url_with_parameters):
+# url = get_url(url_with_parameters, as_str)
+# assert (
+# merge_params(url, {'x': 42}) ==
URL('http://example.com/api?foo=bar&x=42#fragment')
+# )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aioresponses-0.6.1/tests/test_pytest.py
new/aioresponses-0.6.2/tests/test_pytest.py
--- old/aioresponses-0.6.1/tests/test_pytest.py 1970-01-01 01:00:00.000000000
+0100
+++ new/aioresponses-0.6.2/tests/test_pytest.py 2019-11-21 21:08:22.000000000
+0100
@@ -0,0 +1,38 @@
+# # -*- coding: utf-8 -*-
+# import asyncio
+#
+# import pytest
+# from aiohttp import ClientSession
+#
+# from aioresponses import aioresponses
+#
+#
+# @pytest.yield_fixture
+# def foo():
+# print('foo')
+# with aioresponses() as m:
+# yield m
+# print('')
+#
+#
+# @pytest.fixture
+# def session():
+# print('session')
+# return ClientSession()
+#
+#
+# @pytest.yield_fixture()
+# def event_loop():
+# loop = asyncio.new_event_loop()
+# asyncio.set_event_loop(loop)
+# yield loop
+# loop.close()
+#
+#
+# @pytest.mark.asyncio
+# async def test_me(foo, session):
+# url = 'http://example.com/api?foo=bar#fragment'
+# foo.get(url, status=204)
+# response = await session.get(url)
+#
+# assert response.status == 204
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/aioresponses-0.6.1/tox.ini
new/aioresponses-0.6.2/tox.ini
--- old/aioresponses-0.6.1/tox.ini 2019-10-01 23:32:40.000000000 +0200
+++ new/aioresponses-0.6.2/tox.ini 2019-11-21 23:22:36.000000000 +0100
@@ -2,12 +2,11 @@
envlist =
flake8,
coverage,
- py35-aiohttp-master
- py35-aiohttp{20,21,22,23,30,31,32,33,34,35}
+ py35-aiohttp{20,21,22,23,30,31,32,33,34,35,36}
py36-aiohttp-master
- py36-aiohttp{20,21,22,23,30,31,32,33,34,35}
+ py36-aiohttp{20,21,22,23,30,31,32,33,34,35,36}
py37-aiohttp-master
- py37-aiohttp{20,21,22,23,30,31,32,33,34,35}
+ py37-aiohttp{30,31,32,33,34,35,36}
skipsdist = True
[testenv:flake8]
@@ -35,6 +34,7 @@
aiohttp33: aiohttp>=3.3,<3.4
aiohttp34: aiohttp>=3.4,<3.5
aiohttp35: aiohttp>=3.5,<3.6
+ aiohttp36: aiohttp>=3.6,<3.7
aiohttp-master: https://github.com/aio-libs/aiohttp/archive/master.tar.gz
-r{toxinidir}/requirements-dev.txt