Skip to content

Commit 2a18945

Browse files
[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 2e9be80) Co-authored-by: Gregory P. Smith <[email protected]>
1 parent 9f831f4 commit 2a18945

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/test/test_ssl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3822,7 +3822,7 @@ def test_min_max_version_mismatch(self):
38223822
server_hostname=hostname) as s:
38233823
with self.assertRaises(ssl.SSLError) as e:
38243824
s.connect((HOST, server.port))
3825-
self.assertRegex("(alert|ALERT)", str(e.exception))
3825+
self.assertRegex(str(e.exception), "(alert|ALERT)")
38263826

38273827
@requires_tls_version('SSLv3')
38283828
def test_min_max_version_sslv3(self):
@@ -4137,7 +4137,7 @@ def cb_raising(ssl_sock, server_name, initial_context):
41374137

41384138
# Allow for flexible libssl error messages.
41394139
regex = "(SSLV3_ALERT_HANDSHAKE_FAILURE|NO_PRIVATE_VALUE)"
4140-
self.assertRegex(regex, cm.exception.reason)
4140+
self.assertRegex(cm.exception.reason, regex)
41414141
self.assertEqual(catch.unraisable.exc_type, ZeroDivisionError)
41424142

41434143
def test_sni_callback_wrong_return_type(self):

0 commit comments

Comments
 (0)