diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2024-06-15 10:33:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-15 10:33:14 (GMT) |
commit | 42ebdd83bb194f054fe5a10b3caa0c3a95be3679 (patch) | |
tree | 1866edda1014c3efe5021b591605a8bedd449e25 /Lib/test/test_exceptions.py | |
parent | d4039d3f6f8cb7738c5cd272dde04171446dfd2b (diff) | |
download | cpython-42ebdd83bb194f054fe5a10b3caa0c3a95be3679.zip cpython-42ebdd83bb194f054fe5a10b3caa0c3a95be3679.tar.gz cpython-42ebdd83bb194f054fe5a10b3caa0c3a95be3679.tar.bz2 |
gh-120544: Add `else: fail()` to tests where exception is expected (#120545)
Diffstat (limited to 'Lib/test/test_exceptions.py')
-rw-r--r-- | Lib/test/test_exceptions.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index 9460d1f..e4f2e3a 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -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()) |