Accomodate the test to the changed behavior of SSLContext.shared_ciphers() in CPython

See: https://github.com/python/cpython/issues/96931

Fixes: rhbz#2203773
This commit is contained in:
Tomáš Hrnčiar 2023-05-16 12:14:35 +02:00
parent 2c7ece9d32
commit c01f448241
2 changed files with 38 additions and 1 deletions

28
4855d71.patch Normal file
View File

@ -0,0 +1,28 @@
From 4855d71ad5535bdff47a0dc5cfe09fb610ff6576 Mon Sep 17 00:00:00 2001
From: Thomas Grainger <tagrain@gmail.com>
Date: Sat, 15 Apr 2023 20:41:24 +0100
Subject: [PATCH] Fix test_ssl_object_attributes
Co-authored-by: Seth Michael Larson <sethmichaellarson@gmail.com>
---
test/test_ssltransport.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/test/test_ssltransport.py b/test/test_ssltransport.py
index a3b7381639..cace51db96 100644
--- a/test/test_ssltransport.py
+++ b/test/test_ssltransport.py
@@ -229,8 +229,11 @@ def test_ssl_object_attributes(self) -> None:
assert ssock.selected_npn_protocol() is None
shared_ciphers = ssock.shared_ciphers()
- assert type(shared_ciphers) == list
- assert len(shared_ciphers) > 0
+ # SSLContext.shared_ciphers() changed behavior completely in a patch version.
+ # See: https://github.com/python/cpython/issues/96931
+ assert shared_ciphers is None or (
+ type(shared_ciphers) is list and len(shared_ciphers) > 0
+ )
assert ssock.compression() is None

View File

@ -5,12 +5,17 @@
Name: python-%{srcname}
Version: 1.26.12
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Python HTTP library with thread-safe connection pooling and file post
License: MIT
URL: https://github.com/urllib3/urllib3
Source0: %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz
# Accomodate the test to the changed behavior of SSLContext.shared_ciphers() in CPython
# See: https://github.com/python/cpython/issues/96931
Patch: https://github.com/urllib3/urllib3/commit/4855d71.patch
BuildArch: noarch
%description
@ -113,6 +118,10 @@ ln -s %{python3_sitelib}/__pycache__/six.cpython-%{python3_version_nodots}.pyc \
%changelog
* Tue May 16 2023 Tomáš Hrnčiar <thrnciar@redhat.com> - 1.26.12-3
- Accomodate the test to the changed behavior of SSLContext.shared_ciphers() in CPython
- Fixes: rhbz#2203773
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.26.12-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild