summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2024-03-29 00:58:37 (GMT)
committerGitHub <noreply@github.com>2024-03-29 00:58:37 (GMT)
commit2e9be80c99f635c2f7761e8356b0260922d6e7a6 (patch)
tree2b19dfc00c99ff62f2f9e9ca9430328457bab331
parent8eec7ed714e65d616573b7331780b0aa43c6ed6a (diff)
downloadcpython-2e9be80c99f635c2f7761e8356b0260922d6e7a6.zip
cpython-2e9be80c99f635c2f7761e8356b0260922d6e7a6.tar.gz
cpython-2e9be80c99f635c2f7761e8356b0260922d6e7a6.tar.bz2
Fix reversed assertRegex checks in test_ssl. (#117351)
-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 bd831ac..794944a 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -3867,7 +3867,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):
@@ -4182,7 +4182,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):