diff options
| author | root <root@alpha.trunkmasters.com> | 2026-06-12 19:09:37 -0500 |
|---|---|---|
| committer | root <root@alpha.trunkmasters.com> | 2026-06-12 19:09:37 -0500 |
| commit | b590c8d7572b727d565cc0b8ff660d43569845de (patch) | |
| tree | 06f7a4102ea4e845df8b66660f252920d52952f9 /dev-python/httpretty/files | |
| parent | 24f9cbfc4c34fdb6a6e03311674414e881ceab47 (diff) | |
| download | baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.gz baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.xz baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.zip | |
Adding metadata
Diffstat (limited to 'dev-python/httpretty/files')
3 files changed, 202 insertions, 0 deletions
diff --git a/dev-python/httpretty/files/httpretty-1.1.4-py314.patch b/dev-python/httpretty/files/httpretty-1.1.4-py314.patch new file mode 100644 index 000000000000..43513c0bd044 --- /dev/null +++ b/dev-python/httpretty/files/httpretty-1.1.4-py314.patch @@ -0,0 +1,41 @@ +From 8d10219036ab18462c0a8e35a5aae80e0d284c57 Mon Sep 17 00:00:00 2001 +From: Steve Kowalik <steven@wedontsleep.org> +Date: Fri, 10 Apr 2026 11:36:31 +1000 +Subject: [PATCH] Support Python 3.14 partial() changes + +functools.partial() was changed in Python 3.14 to be a method +descriptor, which means we need to wrap it in staticmethod now. This +change does appear to be backward compatible, so I haven't guarded it +with a version check. +--- + httpretty/core.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/httpretty/core.py b/httpretty/core.py +index 69686458..2cea6a89 100644 +--- a/httpretty/core.py ++++ b/httpretty/core.py +@@ -1852,7 +1852,7 @@ def apply_patch_socket(): + extract_into_urllib3() + + if requests_urllib3_connection is not None: +- urllib3_wrap = partial(fake_wrap_socket, old_requests_ssl_wrap_socket) ++ urllib3_wrap = staticmethod(partial(fake_wrap_socket, old_requests_ssl_wrap_socket)) + requests_urllib3_connection.ssl_wrap_socket = urllib3_wrap + requests_urllib3_connection.__dict__['ssl_wrap_socket'] = urllib3_wrap + +@@ -1867,12 +1867,12 @@ def apply_patch_socket(): + socks.__dict__['socksocket'] = fakesock.socket + + if ssl: +- new_wrap = partial(fake_wrap_socket, old_ssl_wrap_socket) ++ new_wrap = staticmethod(partial(fake_wrap_socket, old_ssl_wrap_socket)) + ssl.wrap_socket = new_wrap + ssl.SSLSocket = FakeSSLSocket + ssl.SSLContext = old_sslcontext_class + try: +- ssl.SSLContext.wrap_socket = partial(fake_wrap_socket, old_ssl_wrap_socket) ++ ssl.SSLContext.wrap_socket = staticmethod(partial(fake_wrap_socket, old_ssl_wrap_socket)) + except AttributeError: + pass + diff --git a/dev-python/httpretty/files/httpretty-1.1.4-pytest.patch b/dev-python/httpretty/files/httpretty-1.1.4-pytest.patch new file mode 100644 index 000000000000..ccb465ce98ea --- /dev/null +++ b/dev-python/httpretty/files/httpretty-1.1.4-pytest.patch @@ -0,0 +1,121 @@ +From 299d50c9cb0ba73343d1a88c202e17f6599fde54 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +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(-) + +diff --git a/tests/functional/test_bypass.py b/tests/functional/test_bypass.py +index e85dfac..cf7e75d 100644 +--- 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_disabled(context): + + @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_unregistered_request(context): + + @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_protocols(context): + + @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. +diff --git a/tests/functional/test_debug.py b/tests/functional/test_debug.py +index 86bf09e..ee742f3 100644 +--- 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(context): + @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(context): + @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_recvfrom(context): + @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_into(context): + @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( +diff --git a/tests/functional/test_requests.py b/tests/functional/test_requests.py +index 55aa109..04a5e80 100644 +--- 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") +-- +2.35.1 + diff --git a/dev-python/httpretty/files/httpretty-1.1.4-urllib3-2.3.patch b/dev-python/httpretty/files/httpretty-1.1.4-urllib3-2.3.patch new file mode 100644 index 000000000000..c559f84fe997 --- /dev/null +++ b/dev-python/httpretty/files/httpretty-1.1.4-urllib3-2.3.patch @@ -0,0 +1,40 @@ +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 69686458..de7e091a 100644 +--- a/httpretty/core.py ++++ b/httpretty/core.py +@@ -861,6 +861,9 @@ def recv_into(self, *args, **kwargs): + 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() |
