gh-107944: Improve error message for getargs with bad keyword arguments (#114792)

This commit is contained in:
Shantanu 2024-02-08 01:04:41 -08:00 committed by GitHub
parent 9e90313320
commit 17689e3c41
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 113 additions and 29 deletions

View file

@ -1917,7 +1917,7 @@ class ImportErrorTests(unittest.TestCase):
self.assertEqual(exc.name, 'somename')
self.assertEqual(exc.path, 'somepath')
msg = "'invalid' is an invalid keyword argument for ImportError"
msg = r"ImportError\(\) got an unexpected keyword argument 'invalid'"
with self.assertRaisesRegex(TypeError, msg):
ImportError('test', invalid='keyword')