summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_exceptions.py
diff options
context:
space:
mode:
authorWilliam Wen <william.wen42@gmail.com>2023-12-01 22:18:16 (GMT)
committerGitHub <noreply@github.com>2023-12-01 22:18:16 (GMT)
commit939fc6d6eab9b7ea8c244d513610dbdd556503a7 (patch)
tree37b5e5e7524e8ce098647566af5d7a3fc7ce30ea /Lib/test/test_exceptions.py
parent5c5022b8625e34f0035ad5a23bc4c2f16649d134 (diff)
downloadcpython-939fc6d6eab9b7ea8c244d513610dbdd556503a7.zip
cpython-939fc6d6eab9b7ea8c244d513610dbdd556503a7.tar.gz
cpython-939fc6d6eab9b7ea8c244d513610dbdd556503a7.tar.bz2
gh-106922: Support multi-line error locations in traceback (attempt 2) (#112097)
Diffstat (limited to 'Lib/test/test_exceptions.py')
-rw-r--r--Lib/test/test_exceptions.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index 8ccf087..c57488e 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -2080,6 +2080,7 @@ class AssertionErrorTests(unittest.TestCase):
""",
[
' 1 < 2 and',
+ ' 3 > 4',
'AssertionError',
],
),
@@ -2087,7 +2088,7 @@ class AssertionErrorTests(unittest.TestCase):
for source, expected in cases:
with self.subTest(source):
result = self.write_source(source)
- self.assertEqual(result[-2:], expected)
+ self.assertEqual(result[-len(expected):], expected)
class SyntaxErrorTests(unittest.TestCase):