Skip to content
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