Skip to content

Commit

Permalink
minor tweak on CompareDigestMixin
Browse files Browse the repository at this point in the history
  • Loading branch information
picnixz committed Mar 3, 2025
1 parent a347ee5 commit 85364b4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Lib/test/test_hmac.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,8 @@ def test_equality_new(self):

class CompareDigestMixin:

def compare_digest(self, a, b):
@staticmethod
def compare_digest(a, b):
"""Implementation of 'a == b' to test."""
raise NotImplementedError

Expand Down Expand Up @@ -1048,9 +1049,9 @@ class HMACCompareDigestTestCase(CompareDigestMixin, unittest.TestCase):

def test_compare_digest_func(self):
if openssl_compare_digest is not None:
self.assertIs(hmac.compare_digest, openssl_compare_digest)
self.assertIs(self.compare_digest, openssl_compare_digest)
else:
self.assertIs(hmac.compare_digest, operator_compare_digest)
self.assertIs(self.compare_digest, operator_compare_digest)


@hashlib_helper.requires_hashlib()
Expand Down

0 comments on commit 85364b4

Please sign in to comment.