From 2875c603b2a7691b55c2046aca54831c91efda8e Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Mon, 19 Apr 2021 07:27:10 +0200 Subject: bpo-43880: Show DeprecationWarnings for deprecated ssl module features (GH-25455) * ssl.OP_NO_SSLv2 * ssl.OP_NO_SSLv3 * ssl.OP_NO_TLSv1 * ssl.OP_NO_TLSv1_1 * ssl.OP_NO_TLSv1_2 * ssl.OP_NO_TLSv1_3 * ssl.PROTOCOL_SSLv2 * ssl.PROTOCOL_SSLv3 * ssl.PROTOCOL_SSLv23 (alias for PROTOCOL_TLS) * ssl.PROTOCOL_TLS * ssl.PROTOCOL_TLSv1 * ssl.PROTOCOL_TLSv1_1 * ssl.PROTOCOL_TLSv1_2 * ssl.TLSVersion.SSLv3 * ssl.TLSVersion.TLSv1 * ssl.TLSVersion.TLSv1_1 * ssl.wrap_socket() * ssl.RAND_pseudo_bytes() * ssl.RAND_egd() (already removed since it's not supported by OpenSSL 1.1.1) * ssl.SSLContext() without a protocol argument * ssl.match_hostname() * hashlib.pbkdf2_hmac() (pure Python implementation, fast OpenSSL function will stay) Signed-off-by: Christian Heimes --- Lib/test/test_hashlib.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Lib/test/test_hashlib.py') diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py index bf9f559400..9e9c874445 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -21,6 +21,7 @@ from test import support from test.support import _4G, bigmemtest from test.support.import_helper import import_fresh_module from test.support import threading_helper +from test.support import warnings_helper from http.client import HTTPException # Were we compiled --with-pydebug or with #define Py_DEBUG? @@ -1021,7 +1022,10 @@ class KDFTests(unittest.TestCase): @unittest.skipIf(builtin_hashlib is None, "test requires builtin_hashlib") def test_pbkdf2_hmac_py(self): - self._test_pbkdf2_hmac(builtin_hashlib.pbkdf2_hmac, builtin_hashes) + with warnings_helper.check_warnings(): + self._test_pbkdf2_hmac( + builtin_hashlib.pbkdf2_hmac, builtin_hashes + ) @unittest.skipUnless(hasattr(openssl_hashlib, 'pbkdf2_hmac'), ' test requires OpenSSL > 1.0') -- cgit v1.2.1