Skip to content

Commit

Permalink
Fix reversed assertRegex checks in test_ssl.
Browse files Browse the repository at this point in the history
  • Loading branch information
gpshead committed Mar 28, 2024
1 parent 6702d2b commit b321eb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/test/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -3867,7 +3867,7 @@ def test_min_max_version_mismatch(self):
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):
Expand Down Expand Up @@ -4182,7 +4182,7 @@ def cb_raising(ssl_sock, server_name, initial_context):

# 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):
Expand Down

0 comments on commit b321eb0

Please sign in to comment.