summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ssl.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_ssl.py')
-rw-r--r--Lib/test/test_ssl.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index 395b2ef..6a2e1c6 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -539,9 +539,9 @@ class BasicSocketTests(unittest.TestCase):
openssl_ver = f"OpenSSL {major:d}.{minor:d}.{patch:d}"
else:
openssl_ver = f"OpenSSL {major:d}.{minor:d}.{fix:d}"
- self.assertTrue(
- s.startswith((openssl_ver, libressl_ver, "AWS-LC")),
- (s, t, hex(n))
+ self.assertStartsWith(
+ s, (openssl_ver, libressl_ver, "AWS-LC"),
+ (t, hex(n))
)
@support.cpython_only
@@ -1668,7 +1668,7 @@ class SSLErrorTests(unittest.TestCase):
regex = "(NO_START_LINE|UNSUPPORTED_PUBLIC_KEY_TYPE)"
self.assertRegex(cm.exception.reason, regex)
s = str(cm.exception)
- self.assertTrue("NO_START_LINE" in s, s)
+ self.assertIn("NO_START_LINE", s)
def test_subclass(self):
# Check that the appropriate SSLError subclass is raised
@@ -1683,7 +1683,7 @@ class SSLErrorTests(unittest.TestCase):
with self.assertRaises(ssl.SSLWantReadError) as cm:
c.do_handshake()
s = str(cm.exception)
- self.assertTrue(s.startswith("The operation did not complete (read)"), s)
+ self.assertStartsWith(s, "The operation did not complete (read)")
# For compatibility
self.assertEqual(cm.exception.errno, ssl.SSL_ERROR_WANT_READ)