gh-120544: Add else: fail() to tests where exception is expected (#120545)

This commit is contained in:
Nikita Sobolev 2024-06-15 13:33:14 +03:00 committed by GitHub
parent d4039d3f6f
commit 42ebdd83bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

View file

@ -1859,6 +1859,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())