summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_exceptions.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-06-15 11:54:07 (GMT)
committerGitHub <noreply@github.com>2024-06-15 11:54:07 (GMT)
commit767c955544fa79486e3e874ed9d74e8991b1060b (patch)
tree71f3dd32c357aea2af70db0465331a320277e4d3 /Lib/test/test_exceptions.py
parente54a28bcc9114f296bd1d63010eedbd0c2140d71 (diff)
downloadcpython-767c955544fa79486e3e874ed9d74e8991b1060b.zip
cpython-767c955544fa79486e3e874ed9d74e8991b1060b.tar.gz
cpython-767c955544fa79486e3e874ed9d74e8991b1060b.tar.bz2
[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 42ebdd83bb194f054fe5a10b3caa0c3a95be3679) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Diffstat (limited to 'Lib/test/test_exceptions.py')
-rw-r--r--Lib/test/test_exceptions.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index 3138f50..7e8e058 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -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())