Sync from SUSE:SLFO:Main python-httpretty revision c690eb9bbbf6e9f11175245fd825faca

This commit is contained in:
Adrian Schröter 2024-09-13 16:20:22 +02:00
parent 6041ac0224
commit 09baf4e9c1
3 changed files with 65 additions and 2 deletions

View File

@ -0,0 +1,26 @@
From 37478cf707c19ea4653c62ba3d101c3887c2ca83 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fvogt@suse.de>
Date: Fri, 22 Mar 2024 08:27:10 +0100
Subject: [PATCH] Fix test_417_openssl.py if pyOpenSSL not available
Only one of the test had the necessary @skipIf.
---
tests/bugfixes/nosetests/test_417_openssl.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/bugfixes/nosetests/test_417_openssl.py b/tests/bugfixes/nosetests/test_417_openssl.py
index 750a3fc..3c2bc6b 100644
--- a/tests/bugfixes/nosetests/test_417_openssl.py
+++ b/tests/bugfixes/nosetests/test_417_openssl.py
@@ -24,6 +24,8 @@ def test_enable_disable_httpretty_extract():
extract_from_urllib3()
expect(urllib3.util.IS_PYOPENSSL).to.be.false
+@skipIf(extract_from_urllib3 is None,
+ "urllib3.contrib.pyopenssl.extract_from_urllib3 does not exist")
def test_enable_disable_httpretty():
"#417 urllib3.contrib.pyopenssl enable -> disable extract"
expect(urllib3.util.IS_PYOPENSSL).to.be.false
--
2.43.0

View File

@ -1,3 +1,26 @@
-------------------------------------------------------------------
Thu May 23 09:37:54 UTC 2024 - Markéta Machová <mmachova@suse.com>
- Skip test failing with requests 2.32.X
* suprisingly not with the CVE, but with gh#psf/requests#6644
-------------------------------------------------------------------
Fri Mar 22 07:33:35 UTC 2024 - Fabian Vogt <fvogt@suse.com>
- Add patch 0001-Fix-test_417_openssl.py-if-pyOpenSSL-not-available.patch:
* Fix tests without pyOpenSSL support in urllib3
-------------------------------------------------------------------
Thu Mar 7 13:24:32 UTC 2024 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- Allow building with python-urllib3 >= 2.x
-------------------------------------------------------------------
Fri Dec 29 12:33:24 UTC 2023 - Antonio Larrosa <alarrosa@suse.com>
- Do not use python-boto3 when building in SLE where it's currently
not available for python311
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Jun 13 08:37:50 UTC 2023 - ecsos <ecsos@opensuse.org> Tue Jun 13 08:37:50 UTC 2023 - ecsos <ecsos@opensuse.org>

View File

@ -1,7 +1,7 @@
# #
# spec file for package python-httpretty # spec file for package python-httpretty
# #
# Copyright (c) 2023 SUSE LLC # Copyright (c) 2024 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -17,6 +17,11 @@
%{?sle15_python_module_pythons} %{?sle15_python_module_pythons}
%if 0%{?suse_version} < 1550
%bcond_with boto3
%else
%bcond_without boto3
%endif
Name: python-httpretty Name: python-httpretty
Version: 1.1.4 Version: 1.1.4
Release: 0 Release: 0
@ -35,7 +40,11 @@ Patch2: double-slash-paths.patch
Patch3: 460-miliseconds_tests.patch Patch3: 460-miliseconds_tests.patch
# PATCH-FIX-OPENSUSE Relax the time for one test case from 2ms to 3ms. # PATCH-FIX-OPENSUSE Relax the time for one test case from 2ms to 3ms.
Patch4: relax-test-callback-response.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
%if %{with boto3}
BuildRequires: %{python_module boto3} BuildRequires: %{python_module boto3}
%endif
BuildRequires: %{python_module eventlet} BuildRequires: %{python_module eventlet}
BuildRequires: %{python_module fakeredis} BuildRequires: %{python_module fakeredis}
BuildRequires: %{python_module freezegun} BuildRequires: %{python_module freezegun}
@ -46,7 +55,7 @@ BuildRequires: %{python_module requests}
BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module sure} BuildRequires: %{python_module sure}
BuildRequires: %{python_module tornado} BuildRequires: %{python_module tornado}
BuildRequires: %{python_module urllib3 with %python-urllib3 < 2} BuildRequires: %{python_module urllib3}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
BuildArch: noarch BuildArch: noarch
@ -59,6 +68,9 @@ It is similar to Ruby's FakeWeb.
%prep %prep
%autosetup -p1 -n httpretty-%{version} %autosetup -p1 -n httpretty-%{version}
%if !%{with boto3}
rm tests/bugfixes/nosetests/test_416_boto3.py
%endif
%build %build
%python_build %python_build
@ -74,6 +86,8 @@ export EVENTLET_NO_GREENDNS=yes
donttest="test_http_passthrough or test_https_passthrough" donttest="test_http_passthrough or test_https_passthrough"
# flaky (too slow) on obs # 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"
# gh#gabrielfalcao/HTTPretty#457
donttest="$donttest or test_httpretty_should_handle_paths_starting_with_two_slashes"
%pytest -k "not (${donttest})" %pytest -k "not (${donttest})"
%files %{python_files} %files %{python_files}