[3.13] gh-120544: Add else: fail() to tests where exception is expected (GH-120545) (#120546)

gh-120544: Add `else: fail()` to tests where exception is expected (GH-120545)
(cherry picked from commit 42ebdd83bb)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
Miss Islington (bot) 2024-06-15 13:54:07 +02:00 committed by GitHub
parent e54a28bcc9
commit 767c955544
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

View file

@ -1836,6 +1836,8 @@ class NameErrorTests(unittest.TestCase):
except self.failureException:
with support.captured_stderr() as err:
sys.__excepthook__(*sys.exc_info())
else:
self.fail("assertRaisesRegex should have failed.")
self.assertIn("aab", err.getvalue())