summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_hashlib.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2022-03-22 15:40:43 (GMT)
committerGitHub <noreply@github.com>2022-03-22 15:40:43 (GMT)
commite03db6d5be7cf2e6b7b55284985c404de98a9420 (patch)
tree5ced2b580243704bec7882e4013eb08612e74ddc /Lib/test/test_hashlib.py
parent492d4109f4d953c478cb48f17aa32adbb912623b (diff)
downloadcpython-e03db6d5be7cf2e6b7b55284985c404de98a9420.zip
cpython-e03db6d5be7cf2e6b7b55284985c404de98a9420.tar.gz
cpython-e03db6d5be7cf2e6b7b55284985c404de98a9420.tar.bz2
bpo-45150: Fix testing under FIPS mode (GH-32046)
Diffstat (limited to 'Lib/test/test_hashlib.py')
-rw-r--r--Lib/test/test_hashlib.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py
index daf6e38..369bbde 100644
--- a/Lib/test/test_hashlib.py
+++ b/Lib/test/test_hashlib.py
@@ -379,6 +379,11 @@ class HashLibTestCase(unittest.TestCase):
def check_file_digest(self, name, data, hexdigest):
hexdigest = hexdigest.lower()
+ try:
+ hashlib.new(name)
+ except ValueError:
+ # skip, algorithm is blocked by security policy.
+ return
digests = [name]
digests.extend(self.constructors_to_test[name])