Skip to content

Commit

Permalink
remove the unconstructable test (not a valid constraint for everything)
Browse files Browse the repository at this point in the history
  • Loading branch information
gpshead committed Feb 15, 2023
1 parent d379e28 commit fb6454d
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions Lib/test/test_hashlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,6 @@ def hash_constructors(self):
def is_fips_mode(self):
return get_fips_mode()

def test_types_unconstructable(self):
for h in self.hash_constructors:
implementation = type(h(b'', usedforsecurity=False))
with self.assertRaises(TypeError):
implementation()

def test_hash_array(self):
a = array.array("b", range(10))
for cons in self.hash_constructors:
Expand Down Expand Up @@ -462,9 +456,9 @@ def check_blocksize_name(self, name, block_size=0, digest_size=0,
self.assertEqual(len(m.hexdigest()), 2*digest_size)
self.assertEqual(m.name, name)
# split for sha3_512 / _sha3.sha3 object
self.assertIn(name.split("_")[0], repr(m))
self.assertIn(name.split("_")[0], repr(m).lower())

def test_blocksize_name(self):
def test_blocksize_and_name(self):
self.check_blocksize_name('md5', 64, 16)
self.check_blocksize_name('sha1', 64, 20)
self.check_blocksize_name('sha224', 64, 28)
Expand Down

0 comments on commit fb6454d

Please sign in to comment.