Skip to content

Commit bfd20ca

Browse files
raminfppicnixz
andauthored
Update Lib/test/test_hmac.py
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
1 parent 38e392b commit bfd20ca

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Lib/test/test_hmac.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,13 +1024,12 @@ def test_hmac_digest_digestmod_parameter(self):
10241024
):
10251025
self.hmac_digest(b'key', b'msg', value)
10261026

1027-
def test_hmac_new_xof_digestmod(self):
1027+
@support.subTests("xof_name", ("shake_128", "shake_256"))
1028+
def test_hmac_new_xof_digestmod(self, xof_name):
10281029
# gh-145200: XOF digests (SHAKE) are not supported by HMAC.
10291030
# Verify that the error path does not leak the EVP_MAC_CTX.
1030-
for xof_name in ('shake_128', 'shake_256'):
1031-
with self.subTest(digestmod=xof_name):
1032-
with self.assertRaises(_hashlib.UnsupportedDigestmodError):
1033-
self.hmac_new(b'key', digestmod=xof_name)
1031+
with self.assertRaises(_hashlib.UnsupportedDigestmodError):
1032+
self.hmac_new(b'key', digestmod=xof_name)
10341033

10351034

10361035
class BuiltinConstructorTestCase(ThroughBuiltinAPIMixin,

0 commit comments

Comments
 (0)