gh-136787: improve exception messages for invalid hash algorithms (#136802)

This commit is contained in:
Bénédikt Tran 2025-07-20 10:49:34 +02:00 committed by GitHub
parent 800d37feca
commit 6be49ee517
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 198 additions and 48 deletions

View file

@ -960,7 +960,7 @@ class PyModuleConstructorTestCase(ThroughModuleAPIMixin, PyConstructorBaseMixin,
with self.assertRaisesRegex(RuntimeError, "custom exception"):
func(b'key', b'msg', raiser)
with self.assertRaisesRegex(ValueError, 'hash type'):
with self.assertRaisesRegex(ValueError, 'unsupported hash algorithm'):
func(b'key', b'msg', 'unknown')
with self.assertRaisesRegex(AttributeError, 'new'):