mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
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>
This commit is contained in:
parent
3d3027c5fc
commit
4823d9a512
18 changed files with 276 additions and 64 deletions
|
|
@ -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. "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue