mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
[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:
parent
e54a28bcc9
commit
767c955544
2 changed files with 12 additions and 0 deletions
|
@ -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())
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue