gh-106922: Support multi-line error locations in traceback (attempt 2) (#112097)

This commit is contained in:
William Wen 2023-12-01 14:18:16 -08:00 committed by GitHub
parent 5c5022b862
commit 939fc6d6ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 706 additions and 124 deletions

View file

@ -2080,6 +2080,7 @@ def test_multiline_not_highlighted(self):
""",
[
' 1 < 2 and',
' 3 > 4',
'AssertionError',
],
),
@ -2087,7 +2088,7 @@ def test_multiline_not_highlighted(self):
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):