mirror of
https://github.com/python/cpython.git
synced 2025-08-09 19:38:42 +00:00
[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 2e9be80c99
)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
This commit is contained in:
parent
9f831f442c
commit
2a18945dc6
1 changed files with 2 additions and 2 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue