We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8d7089f commit 1c6af67Copy full SHA for 1c6af67
Lib/test/test_sys_settrace.py
@@ -1571,6 +1571,31 @@ def func():
1571
1572
self.run_and_compare(func, EXPECTED_EVENTS)
1573
1574
+ def test_very_large_function(self):
1575
+ # There is a separate code path when the number of lines > (1 << 15).
1576
+ d = {}
1577
+ exec("""def f(): # line 0
1578
+ x = 0 # line 1
1579
+ y = 1 # line 2
1580
+ ''' # line 3
1581
+ %s # lines 4 through (1 << 16)
1582
+ ''' #
1583
+ x += 1 #
1584
+ return""" % ('\n' * (1 << 16),), d)
1585
+ f = d['f']
1586
+
1587
+ EXPECTED_EVENTS = [
1588
+ (0, 'call'),
1589
+ (1, 'line'),
1590
+ (2, 'line'),
1591
+ (3, 'line'),
1592
+ (65542, 'line'),
1593
+ (65543, 'line'),
1594
+ (65543, 'return'),
1595
+ ]
1596
1597
+ self.run_and_compare(f, EXPECTED_EVENTS)
1598
1599
1600
EVENT_NAMES = [
1601
'call',
0 commit comments