Skip to content

Commit 2e9be80

Browse files
authored
Fix reversed assertRegex checks in test_ssl. (#117351)
1 parent 8eec7ed commit 2e9be80

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/test/test_ssl.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3867,7 +3867,7 @@ def test_min_max_version_mismatch(self):
38673867
server_hostname=hostname) as s:
38683868
with self.assertRaises(ssl.SSLError) as e:
38693869
s.connect((HOST, server.port))
3870-
self.assertRegex("(alert|ALERT)", str(e.exception))
3870+
self.assertRegex(str(e.exception), "(alert|ALERT)")
38713871

38723872
@requires_tls_version('SSLv3')
38733873
def test_min_max_version_sslv3(self):
@@ -4182,7 +4182,7 @@ def cb_raising(ssl_sock, server_name, initial_context):
41824182

41834183
# Allow for flexible libssl error messages.
41844184
regex = "(SSLV3_ALERT_HANDSHAKE_FAILURE|NO_PRIVATE_VALUE)"
4185-
self.assertRegex(regex, cm.exception.reason)
4185+
self.assertRegex(cm.exception.reason, regex)
41864186
self.assertEqual(catch.unraisable.exc_type, ZeroDivisionError)
41874187

41884188
def test_sni_callback_wrong_return_type(self):

0 commit comments

Comments
 (0)