summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-03-29 01:19:04 (GMT)
committerGitHub <noreply@github.com>2024-03-29 01:19:04 (GMT)
commit2a18945dc6e1c6e4daf55ec5a3aa07679df1cb1d (patch)
treebe95779baebbba81079119f12b5c3ed99ca100ff
parent9f831f442c8b0ff625887ed33dda80e1f77ee1aa (diff)
downloadcpython-2a18945dc6e1c6e4daf55ec5a3aa07679df1cb1d.zip
cpython-2a18945dc6e1c6e4daf55ec5a3aa07679df1cb1d.tar.gz
cpython-2a18945dc6e1c6e4daf55ec5a3aa07679df1cb1d.tar.bz2
[3.12] Fix reversed assertRegex checks in test_ssl. (GH-117351) (#117359)
Fix reversed assertRegex checks in test_ssl. (GH-117351) (cherry picked from commit 2e9be80c99f635c2f7761e8356b0260922d6e7a6) Co-authored-by: Gregory P. Smith <greg@krypto.org>
-rw-r--r--Lib/test/test_ssl.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index f3960be..9b59ddd 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -3822,7 +3822,7 @@ class ThreadedTests(unittest.TestCase):
server_hostname=hostname) as s:
with self.assertRaises(ssl.SSLError) as e:
s.connect((HOST, server.port))
- self.assertRegex("(alert|ALERT)", str(e.exception))
+ self.assertRegex(str(e.exception), "(alert|ALERT)")
@requires_tls_version('SSLv3')
def test_min_max_version_sslv3(self):
@@ -4137,7 +4137,7 @@ class ThreadedTests(unittest.TestCase):
# Allow for flexible libssl error messages.
regex = "(SSLV3_ALERT_HANDSHAKE_FAILURE|NO_PRIVATE_VALUE)"
- self.assertRegex(regex, cm.exception.reason)
+ self.assertRegex(cm.exception.reason, regex)
self.assertEqual(catch.unraisable.exc_type, ZeroDivisionError)
def test_sni_callback_wrong_return_type(self):