summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib
diff options
context:
space:
mode:
authorAmmar Askar <ammar@ammaraskar.com>2021-07-07 19:07:12 (GMT)
committerGitHub <noreply@github.com>2021-07-07 19:07:12 (GMT)
commit4823d9a51281ebbc8e8d82a0dd3edc7d13ea8ac7 (patch)
treeb7c97af7b1d15da75321e1434997163cd8c6b9d0 /Lib/idlelib
parent3d3027c5fcc683c14ee55ad231d79971ba12b24d (diff)
downloadcpython-4823d9a51281ebbc8e8d82a0dd3edc7d13ea8ac7.zip
cpython-4823d9a51281ebbc8e8d82a0dd3edc7d13ea8ac7.tar.gz
cpython-4823d9a51281ebbc8e8d82a0dd3edc7d13ea8ac7.tar.bz2
bpo-43950: Add option to opt-out of PEP-657 (GH-27023)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com> Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
Diffstat (limited to 'Lib/idlelib')
-rw-r--r--Lib/idlelib/idle_test/test_run.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/Lib/idlelib/idle_test/test_run.py b/Lib/idlelib/idle_test/test_run.py
index b289fa7..d859ffc 100644
--- a/Lib/idlelib/idle_test/test_run.py
+++ b/Lib/idlelib/idle_test/test_run.py
@@ -3,7 +3,7 @@
from idlelib import run
import io
import sys
-from test.support import captured_output, captured_stderr
+from test.support import captured_output, captured_stderr, has_no_debug_ranges
import unittest
from unittest import mock
import idlelib
@@ -33,9 +33,14 @@ class ExceptionTest(unittest.TestCase):
run.print_exception()
tb = output.getvalue().strip().splitlines()
- self.assertEqual(13, len(tb))
- self.assertIn('UnhashableException: ex2', tb[4])
- self.assertIn('UnhashableException: ex1', tb[12])
+ 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])
data = (('1/0', ZeroDivisionError, "division by zero\n"),
('abc', NameError, "name 'abc' is not defined. "