Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use subTest to id the algorithm.
  • Loading branch information
gpshead authored and xnox committed Sep 8, 2025
commit 3910723fde6bd4edc161925b5943c146c77ff4c5
5 changes: 3 additions & 2 deletions Lib/test/_test_hashlib_fips.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ def test_algorithms_available(self):
# all available algorithms must be loadable, bpo-47101
self.assertNotIn("undefined", hashlib.algorithms_available)
for name in hashlib.algorithms_available:
digest = hashlib.new(name, usedforsecurity=False)
with self.subTest(name):
digest = hashlib.new(name, usedforsecurity=False)

def test_usedforsecurity_true(self):
import hashlib
for name in hashlib.algorithms_available:
with self.assertRaises(ValueError):
with self.subTest(name), self.assertRaises(ValueError):
digest = hashlib.new(name, usedforsecurity=True)

if __name__ == "__main__":
Expand Down