Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-httpretty for
openSUSE:Factory checked in at 2022-08-10 17:12:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-httpretty (Old)
and /work/SRC/openSUSE:Factory/.python-httpretty.new.1521 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-httpretty"
Wed Aug 10 17:12:27 2022 rev:21 rq:993919 version:1.1.4
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-httpretty/python-httpretty.changes
2022-05-06 18:58:20.649291290 +0200
+++
/work/SRC/openSUSE:Factory/.python-httpretty.new.1521/python-httpretty.changes
2022-08-10 17:12:36.057598516 +0200
@@ -1,0 +2,19 @@
+Sun Aug 8 09:17:40 UTC 2022 - Ben Greiner <[email protected]>
+
+- Fix test suite:
+ * Remove nose idioms
+ * Remove outdated test skips
+
+-------------------------------------------------------------------
+Mon Aug 8 02:53:55 UTC 2022 - Steve Kowalik <[email protected]>
+
+- Add patch double-slash-paths.patch:
+ * http.request may replace // with /, handle that in the testcase.
+
+-------------------------------------------------------------------
+Sat Aug 6 17:32:34 UTC 2022 - Matej Cepl <[email protected]>
+
+- Add 453-fix-tests-pytest.patch (gh#gabrielfalcao/HTTPretty#449)
+ to make tests compatible with pytest.
+
+-------------------------------------------------------------------
New:
----
453-fix-tests-pytest.patch
double-slash-paths.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-httpretty.spec ++++++
--- /var/tmp/diff_new_pack.G7QPva/_old 2022-08-10 17:12:36.793600438 +0200
+++ /var/tmp/diff_new_pack.G7QPva/_new 2022-08-10 17:12:36.801600459 +0200
@@ -26,11 +26,19 @@
URL: https://github.com/gabrielfalcao/HTTPretty
Source:
https://files.pythonhosted.org/packages/source/h/httpretty/httpretty-%{version}.tar.gz
Patch0: remove-mock.patch
+# PATCH-FIX-UPSTREAM 453-fix-tests-pytest.patch gh#gabrielfalcao/HTTPretty#449
[email protected]
+# Make tests compatible with pytest
+Patch1: 453-fix-tests-pytest.patch
+# PATCH-FIX-OPENSUSE test_double_slash may be replaced with / from stdlib
+# gh#gabrielfalcao/HTTPretty#457
+Patch2: double-slash-paths.patch
+BuildRequires: %{python_module boto3}
BuildRequires: %{python_module eventlet}
BuildRequires: %{python_module fakeredis}
BuildRequires: %{python_module freezegun}
BuildRequires: %{python_module httplib2}
-BuildRequires: %{python_module nose2}
+BuildRequires: %{python_module pytest-httpserver}
+BuildRequires: %{python_module pytest}
BuildRequires: %{python_module requests}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module sure}
@@ -47,10 +55,6 @@
%prep
%autosetup -p1 -n httpretty-%{version}
-# no test coverage check needed
-sed -i -e '/cover/ d' setup.cfg
-# no color printout for tests
-sed -i -e '/rednose/ d' setup.cfg
%build
%python_build
@@ -60,16 +64,13 @@
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
-# https://github.com/gabrielfalcao/HTTPretty/issues/405
+# gh#gabrielfalcao/HTTPretty#405
export EVENTLET_NO_GREENDNS=yes
-# test_http_passthrough and test_https_passthrough need internet connection
-sed -Ei 's/(test_https?_passthrough)/_\1/' tests/functional/test_passthrough.py
-# fails on 15.1
-sed -Ei 's/(test_streaming_responses)/_\1/' tests/functional/test_requests.py
-# fails on x86_64
-sed -Ei
's/(test_fakesock_socket_sendall_with_body_data_with_chunked_entry)/_\1/'
tests/unit/test_core.py
-
-%python_exec -m nose2 -v
+# needs internet connection to httpbin.org
+donttest="test_http_passthrough or test_https_passthrough"
+# flaky (too slow) on obs
+donttest="$donttest or test_httpretty_should_allow_forcing_headers_urllib2"
+%pytest -k "not (${donttest})"
%files %{python_files}
%license COPYING
++++++ 453-fix-tests-pytest.patch ++++++
>From 299d50c9cb0ba73343d1a88c202e17f6599fde54 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <[email protected]>
Date: Sat, 14 May 2022 13:39:13 +0200
Subject: [PATCH] Fix functional tests compatibility with pytest
Provide a default value for test parameters provided by decorators
in order to prevent pytest from recognizing them as fixtures. This
is the smaller change needed to run the complete test suite via pytest.
Fixes #449
---
tests/functional/test_bypass.py | 8 ++++----
tests/functional/test_debug.py | 10 +++++-----
tests/functional/test_requests.py | 2 +-
3 files changed, 10 insertions(+), 10 deletions(-)
--- a/tests/functional/test_bypass.py
+++ b/tests/functional/test_bypass.py
@@ -88,7 +88,7 @@ def stop_tcp_server(context):
@httpretty.activate
@that_with_context(start_http_server, stop_http_server)
-def test_httpretty_bypasses_when_disabled(context):
+def test_httpretty_bypasses_when_disabled(context=None):
"httpretty should bypass all requests by disabling it"
httpretty.register_uri(
@@ -122,7 +122,7 @@ def test_httpretty_bypasses_when_disable
@httpretty.activate(verbose=True)
@that_with_context(start_http_server, stop_http_server)
-def test_httpretty_bypasses_a_unregistered_request(context):
+def test_httpretty_bypasses_a_unregistered_request(context=None):
"httpretty should bypass a unregistered request by disabling it"
httpretty.register_uri(
@@ -145,7 +145,7 @@ def test_httpretty_bypasses_a_unregister
@httpretty.activate(verbose=True)
@that_with_context(start_tcp_server, stop_tcp_server)
-def test_using_httpretty_with_other_tcp_protocols(context):
+def test_using_httpretty_with_other_tcp_protocols(context=None):
"httpretty should work even when testing code that also use other
TCP-based protocols"
httpretty.register_uri(
@@ -163,7 +163,7 @@ def test_using_httpretty_with_other_tcp_
@httpretty.activate(allow_net_connect=False)
@that_with_context(start_http_server, stop_http_server)
-def test_disallow_net_connect_1(context, verbose=True):
+def test_disallow_net_connect_1(context=None, verbose=True):
"""
When allow_net_connect = False, a request that otherwise
would have worked results in UnmockedError.
--- a/tests/functional/test_debug.py
+++ b/tests/functional/test_debug.py
@@ -39,7 +39,7 @@ def create_socket(context):
@skip('not currently supported')
@httprettified
@scenario(create_socket)
-def test_httpretty_debugs_socket_send(context):
+def test_httpretty_debugs_socket_send(context=None):
"HTTPretty should forward_and_trace socket.send"
expect(context.sock.send).when.called_with(b'data').to.throw(
@@ -50,7 +50,7 @@ def test_httpretty_debugs_socket_send(co
@skip('not currently supported')
@httprettified
@scenario(create_socket)
-def test_httpretty_debugs_socket_sendto(context):
+def test_httpretty_debugs_socket_sendto(context=None):
"HTTPretty should forward_and_trace socket.sendto"
expect(context.sock.sendto).when.called.to.throw(
@@ -61,7 +61,7 @@ def test_httpretty_debugs_socket_sendto(
@skip('not currently supported')
@httprettified
@scenario(create_socket)
-def test_httpretty_debugs_socket_recvfrom(context):
+def test_httpretty_debugs_socket_recvfrom(context=None):
"HTTPretty should forward_and_trace socket.recvfrom"
expect(context.sock.recvfrom).when.called.to.throw(
@@ -72,7 +72,7 @@ def test_httpretty_debugs_socket_recvfro
@skip('not currently supported')
@httprettified
@scenario(create_socket)
-def test_httpretty_debugs_socket_recv_into(context):
+def test_httpretty_debugs_socket_recv_into(context=None):
"HTTPretty should forward_and_trace socket.recv_into"
buf = bytearray()
expect(context.sock.recv_into).when.called_with(buf).to.throw(
@@ -83,7 +83,7 @@ def test_httpretty_debugs_socket_recv_in
@skip('not currently supported')
@httprettified
@scenario(create_socket)
-def test_httpretty_debugs_socket_recvfrom_into(context):
+def test_httpretty_debugs_socket_recvfrom_into(context=None):
"HTTPretty should forward_and_trace socket.recvfrom_into"
expect(context.sock.recvfrom_into).when.called.to.throw(
--- a/tests/functional/test_requests.py
+++ b/tests/functional/test_requests.py
@@ -768,7 +768,7 @@ def test_unicode_querystrings():
@use_tornado_server
-def test_recording_calls(port):
+def test_recording_calls(port=None):
("HTTPretty should be able to record calls")
# Given a destination path:
destination = FIXTURE_FILE("recording-1.json")
++++++ double-slash-paths.patch ++++++
Index: httpretty-1.1.4/tests/functional/test_requests.py
===================================================================
--- httpretty-1.1.4.orig/tests/functional/test_requests.py
+++ httpretty-1.1.4/tests/functional/test_requests.py
@@ -946,4 +946,4 @@ def test_httpretty_should_handle_paths_s
response = requests.get('http://example.com//foo')
expect(response.text).to.equal('Find the best foo')
expect(HTTPretty.last_request.method).to.equal('GET')
- expect(HTTPretty.last_request.path).to.equal('//foo')
+ expect(HTTPretty.last_request.path).to.be.within(['//foo', '/foo'])