Skip to content

Commit e1b14f4

Browse files
committed
update comment
1 parent ac6b983 commit e1b14f4

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

Lib/test/test_hmac.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,18 +1516,23 @@ def test_hmac_digest_overflow_error_builtin_only(self, size):
15161516
self.do_test_hmac_digest_overflow_error_switch_to_slow(hmac, size)
15171517

15181518
def do_test_hmac_digest_overflow_error_switch_to_slow(self, hmac, size):
1519-
"""Check that hmac.digest() falls back to pure Python."""
1519+
"""Check that hmac.digest() falls back to pure Python.
1520+
1521+
The *hmac* argument implements the HMAC module interface.
1522+
The *size* argument is a large key size or message size that would
1523+
trigger an OverflowError in the C implementation(s) of hmac.digest().
1524+
"""
15201525

15211526
bigkey = b'K' * size
15221527
bigmsg = b'M' * size
15231528

15241529
with patch.object(hmac, "_compute_digest_fallback") as slow:
15251530
hmac.digest(bigkey, b'm', "md5")
1526-
slow.assert_called_once()
1531+
slow.assert_called_once()
15271532

15281533
with patch.object(hmac, "_compute_digest_fallback") as slow:
15291534
hmac.digest(b'k', bigmsg, "md5")
1530-
slow.assert_called_once()
1535+
slow.assert_called_once()
15311536

15321537
@hashlib_helper.requires_hashdigest("md5", openssl=True)
15331538
@bigmemtest(size=_4G + 5, memuse=2, dry_run=False)

0 commit comments

Comments
 (0)