summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_hmac.py
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@innova.no>2021-05-27 06:43:52 (GMT)
committerGitHub <noreply@github.com>2021-05-27 06:43:52 (GMT)
commitfbff5387c3e1f3904420fa5a27738c6c5881305b (patch)
treea4e01083dde3afdde7306e55f70c1493fdc07b0a /Lib/test/test_hmac.py
parent3e7ee02327db13e4337374597cdc4458ecb9e3ad (diff)
downloadcpython-fbff5387c3e1f3904420fa5a27738c6c5881305b.zip
cpython-fbff5387c3e1f3904420fa5a27738c6c5881305b.tar.gz
cpython-fbff5387c3e1f3904420fa5a27738c6c5881305b.tar.bz2
bpo-43988: Use check disallow instantiation helper (GH-26392)
Diffstat (limited to 'Lib/test/test_hmac.py')
-rw-r--r--Lib/test/test_hmac.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/Lib/test/test_hmac.py b/Lib/test/test_hmac.py
index 964acd0..7cf9973 100644
--- a/Lib/test/test_hmac.py
+++ b/Lib/test/test_hmac.py
@@ -6,7 +6,7 @@ import unittest
import unittest.mock
import warnings
-from test.support import hashlib_helper
+from test.support import hashlib_helper, check_disallow_instantiation
from _operator import _compare_digest as operator_compare_digest
@@ -439,11 +439,7 @@ class ConstructorTestCase(unittest.TestCase):
@unittest.skipUnless(C_HMAC is not None, 'need _hashlib')
def test_internal_types(self):
# internal types like _hashlib.C_HMAC are not constructable
- with self.assertRaisesRegex(
- TypeError, "cannot create '_hashlib.HMAC' instance"
- ):
- C_HMAC()
-
+ check_disallow_instantiation(self, C_HMAC)
with self.assertRaisesRegex(TypeError, "immutable type"):
C_HMAC.value = None