17
0

6 Commits

Author SHA256 Message Date
552b1d1dad Accepting request 1290928 from devel:languages:python
- Switch to pyproject macros.

OBS-URL: https://build.opensuse.org/request/show/1290928
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-httpretty?expand=0&rev=32
2025-07-08 13:27:57 +00:00
35aef9b7f1 - Switch to pyproject macros.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-httpretty?expand=0&rev=72
2025-07-07 02:33:05 +00:00
2c9a4abf91 Accepting request 1280753 from devel:languages:python
To Staging:D, Fix compatibility with latest python-urllib3 in
sr#1280514

- Add 0001-Mock-socket.shutdown-for-compatibility-with-urllib3-.patch:
  * Mock socket.shutdown for compatibility with urllib3 >= 2.3

OBS-URL: https://build.opensuse.org/request/show/1280753
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-httpretty?expand=0&rev=31
2025-05-31 17:14:22 +00:00
2972938c56 - Add 0001-Mock-socket.shutdown-for-compatibility-with-urllib3-.patch:
* Mock socket.shutdown for compatibility with urllib3 >= 2.3

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-httpretty?expand=0&rev=70
2025-05-28 06:03:24 +00:00
7d5e9c51e2 Accepting request 1239458 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1239458
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-httpretty?expand=0&rev=30
2025-01-23 16:56:41 +00:00
38b10ee046 Accepting request 1239318 from home:Guillaume_G:branches:devel:languages:python
- Skip test_httpretty_provides_easy_access_to_querystrings as it is
  flaky on OBS workers

OBS-URL: https://build.opensuse.org/request/show/1239318
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-httpretty?expand=0&rev=68
2025-01-22 09:11:32 +00:00
3 changed files with 69 additions and 5 deletions

View File

@@ -0,0 +1,43 @@
From 8e96b1e312d473429fbd08bc867376e9932ad42a Mon Sep 17 00:00:00 2001
From: Carl Smedstad <carl.smedstad@protonmail.com>
Date: Mon, 30 Dec 2024 19:08:26 +0100
Subject: [PATCH] Mock socket.shutdown for compatibility with urllib3 >= 2.3
Version 2.3.0 of urllib3 gets the attribute socket.shutdown which
HTTPretty does no mock. See the following call stack:
/usr/lib/python3.13/site-packages/requests/sessions.py:602: in get
return self.request("GET", url, **kwargs)
/usr/lib/python3.13/site-packages/requests/sessions.py:589: in request
resp = self.send(prep, **send_kwargs)
/usr/lib/python3.13/site-packages/requests/sessions.py:703: in send
r = adapter.send(request, **kwargs)
/usr/lib/python3.13/site-packages/requests/adapters.py:667: in send
resp = conn.urlopen(
/usr/lib/python3.13/site-packages/urllib3/connectionpool.py:787: in urlopen
response = self._make_request(
/usr/lib/python3.13/site-packages/urllib3/connectionpool.py:534: in _make_request
response = conn.getresponse()
/usr/lib/python3.13/site-packages/urllib3/connection.py:513: in getresponse
_shutdown = getattr(self.sock, "shutdown", None)
---
httpretty/core.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/httpretty/core.py b/httpretty/core.py
index 6968645..de7e091 100644
--- a/httpretty/core.py
+++ b/httpretty/core.py
@@ -861,6 +861,9 @@ class fakesock(object):
def recvfrom(self, *args, **kwargs):
return self.forward_and_trace('recvfrom', *args, **kwargs)
+ def shutdown(self, *args, **kwargs):
+ return self.forward_and_trace('shutdown', *args, **kwargs)
+
def recv(self, buffersize=0, *args, **kwargs):
if not self._read_buf:
self._read_buf = io.BytesIO()
--
2.49.0

View File

@@ -1,3 +1,20 @@
-------------------------------------------------------------------
Mon Jul 7 02:32:42 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- Switch to pyproject macros.
-------------------------------------------------------------------
Wed May 28 06:01:26 UTC 2025 - Daniel Garcia <daniel.garcia@suse.com>
- Add 0001-Mock-socket.shutdown-for-compatibility-with-urllib3-.patch:
* Mock socket.shutdown for compatibility with urllib3 >= 2.3
-------------------------------------------------------------------
Tue Jan 21 14:46:01 UTC 2025 - Guillaume GARDET <guillaume.gardet@opensuse.org>
- Skip test_httpretty_provides_easy_access_to_querystrings as it is
flaky on OBS workers
-------------------------------------------------------------------
Thu May 23 09:37:54 UTC 2024 - Markéta Machová <mmachova@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-httpretty
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -42,6 +42,8 @@ Patch3: 460-miliseconds_tests.patch
Patch4: relax-test-callback-response.patch
# PATCH-FIX-UPSTREAM https://github.com/gabrielfalcao/HTTPretty/pull/480
Patch5: 0001-Fix-test_417_openssl.py-if-pyOpenSSL-not-available.patch
# PATCH-FIX-UPSTREAM https://github.com/gabrielfalcao/HTTPretty/pull/485
Patch6: 0001-Mock-socket.shutdown-for-compatibility-with-urllib3-.patch
%if %{with boto3}
BuildRequires: %{python_module boto3}
%endif
@@ -49,6 +51,7 @@ BuildRequires: %{python_module eventlet}
BuildRequires: %{python_module fakeredis}
BuildRequires: %{python_module freezegun}
BuildRequires: %{python_module httplib2}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest-httpserver}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module requests}
@@ -56,6 +59,7 @@ BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module sure}
BuildRequires: %{python_module tornado}
BuildRequires: %{python_module urllib3}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildArch: noarch
@@ -73,10 +77,10 @@ rm tests/bugfixes/nosetests/test_416_boto3.py
%endif
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
@@ -85,7 +89,7 @@ export EVENTLET_NO_GREENDNS=yes
# 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 or test_httpretty_should_allow_registering_regexes_with_streaming_responses"
donttest="$donttest or test_httpretty_should_allow_forcing_headers_urllib2 or test_httpretty_should_allow_registering_regexes_with_streaming_responses or test_httpretty_provides_easy_access_to_querystrings"
# gh#gabrielfalcao/HTTPretty#457
donttest="$donttest or test_httpretty_should_handle_paths_starting_with_two_slashes"
%pytest -k "not (${donttest})"
@@ -94,6 +98,6 @@ donttest="$donttest or test_httpretty_should_handle_paths_starting_with_two_slas
%license COPYING
%doc README.rst
%{python_sitelib}/httpretty
%{python_sitelib}/httpretty-%{version}*-info
%{python_sitelib}/httpretty-%{version}.dist-info
%changelog