Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh-93883: elide traceback indicators when possible #93994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jul 11, 2022
Prev Previous commit
Next Next commit
fix test_idle
  • Loading branch information
belm0 committed Jun 24, 2022
commit bba12b12a605e1154c95f479e5fdea9d15f23acf
13 changes: 4 additions & 9 deletions Lib/idlelib/idle_test/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from idlelib import run
import io
import sys
from test.support import captured_output, captured_stderr, has_no_debug_ranges
from test.support import captured_output, captured_stderr
import unittest
from unittest import mock
import idlelib
Expand Down Expand Up @@ -33,14 +33,9 @@ def __eq__(self, other):
run.print_exception()

tb = output.getvalue().strip().splitlines()
if has_no_debug_ranges():
self.assertEqual(11, len(tb))
self.assertIn('UnhashableException: ex2', tb[3])
self.assertIn('UnhashableException: ex1', tb[10])
else:
self.assertEqual(13, len(tb))
self.assertIn('UnhashableException: ex2', tb[4])
self.assertIn('UnhashableException: ex1', tb[12])
self.assertEqual(11, len(tb))
self.assertIn('UnhashableException: ex2', tb[3])
self.assertIn('UnhashableException: ex1', tb[10])

data = (('1/0', ZeroDivisionError, "division by zero\n"),
('abc', NameError, "name 'abc' is not defined. "
Expand Down