diff options
Diffstat (limited to 'Lib/test/test_hmac.py')
-rw-r--r-- | Lib/test/test_hmac.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_hmac.py b/Lib/test/test_hmac.py index 1bbf201..ea00367 100644 --- a/Lib/test/test_hmac.py +++ b/Lib/test/test_hmac.py @@ -312,10 +312,15 @@ class TestVectorsTestCase(unittest.TestCase): self.fail('Expected warning about small block_size') def test_with_digestmod_no_default(self): - with self.assertRaises(ValueError): + """The digestmod parameter is required as of Python 3.8.""" + with self.assertRaisesRegex(TypeError, r'required.*digestmod'): key = b"\x0b" * 16 data = b"Hi There" hmac.HMAC(key, data, digestmod=None) + with self.assertRaisesRegex(TypeError, r'required.*digestmod'): + hmac.new(key, data) + with self.assertRaisesRegex(TypeError, r'required.*digestmod'): + hmac.HMAC(key, msg=data, digestmod='') class ConstructorTestCase(unittest.TestCase): |