bpo-46431: improve error message on invalid calls to BaseExceptionGroup.__new__ (GH-30854)

This commit is contained in:
Irit Katriel 2022-01-24 21:47:40 +00:00 committed by GitHub
parent 1c705fda8f
commit 573b545157
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View file

@ -22,7 +22,7 @@ class TestExceptionGroupTypeHierarchy(unittest.TestCase):
class BadConstructorArgs(unittest.TestCase):
def test_bad_EG_construction__too_many_args(self):
MSG = 'function takes exactly 2 arguments'
MSG = 'BaseExceptionGroup.__new__\(\) takes exactly 2 arguments'
with self.assertRaisesRegex(TypeError, MSG):
ExceptionGroup('no errors')
with self.assertRaisesRegex(TypeError, MSG):