MCPcopy Index your code
hub / github.com/python/cpython / test_threaded_hashing_fast

Method test_threaded_hashing_fast

Lib/test/test_hashlib.py:1095–1109  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1093 @threading_helper.reap_threads
1094 @threading_helper.requires_working_threading()
1095 def test_threaded_hashing_fast(self):
1096 # Same as test_threaded_hashing_slow() but only tests some functions
1097 # since otherwise test_hashlib.py becomes too slow during development.
1098 algos = ['md5', 'sha1', 'sha256', 'sha3_256', 'blake2s']
1099 for name in algos:
1100 if constructor := getattr(hashlib, name, None):
1101 with self.subTest(name):
1102 try:
1103 self.do_test_threaded_hashing(constructor, is_shake=False)
1104 except ValueError as exc:
1105 self.skip_if_blake2_not_builtin(name, exc)
1106 raise
1107
1108 if shake_128 := getattr(hashlib, 'shake_128', None):
1109 self.do_test_threaded_hashing(shake_128, is_shake=True)
1110
1111 @requires_resource('cpu')
1112 @threading_helper.reap_threads

Callers

nothing calls this directly

Calls 3

subTestMethod · 0.45

Tested by

no test coverage detected