File trio-pr2043-py310ssl-deprecationwarnings.patch of Package python-trio

From 0639f87e58bae400070c5642f6fb339c7bb6e704 Mon Sep 17 00:00:00 2001
From: Kyle Altendorf <sda@fstab.net>
Date: Tue, 22 Jun 2021 11:33:12 -0400
Subject: [PATCH] update tests for SSL related deprecations in 3.10

---
 trio/tests/test_ssl.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/trio/tests/test_ssl.py b/trio/tests/test_ssl.py
index 75f99df13..933e0be47 100644
--- a/trio/tests/test_ssl.py
+++ b/trio/tests/test_ssl.py
@@ -80,7 +80,10 @@ def client_ctx(request):
     if request.param in ["default", "tls13"]:
         return ctx
     elif request.param == "tls12":
-        ctx.options |= ssl.OP_NO_TLSv1_3
+        if sys.version_info >= (3, 7):
+            ctx.maximum_version = ssl.TLSVersion.TLSv1_2
+        else:
+            ctx.options |= ssl.OP_NO_TLSv1_3
         return ctx
     else:  # pragma: no cover
         assert False
@@ -1200,7 +1203,8 @@ async def test_selected_npn_protocol_before_handshake(client_ctx):
 
 
 @pytest.mark.filterwarnings(
-    r"ignore: ssl module. NPN is deprecated, use ALPN instead:UserWarning"
+    r"ignore: ssl module. NPN is deprecated, use ALPN instead:UserWarning",
+    r"ignore:ssl NPN is deprecated, use ALPN instead:DeprecationWarning",
 )
 async def test_selected_npn_protocol_when_not_set(client_ctx):
     # NPN protocol still returns None when it's not set,
openSUSE Build Service is sponsored by