aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_sys_settrace.py
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2022-01-11 11:28:30 +0000
committerGitHub <noreply@github.com>2022-01-11 11:28:30 +0000
commitbd04fac7eb929cd11ab6985deb61d9780447fbff (patch)
treefa1f7cd473f62ffa309b0c0b48d88a655a4a7e35 /Lib/test/test_sys_settrace.py
parentea1a54506b4ac38b712ba63ec884292025f16111 (diff)
downloadcpython-bd04fac7eb929cd11ab6985deb61d9780447fbff.tar.gz
cpython-bd04fac7eb929cd11ab6985deb61d9780447fbff.zip
bpo-46331: Do not set line number of instruction storing doc-string. (GH-30518)
Diffstat (limited to 'Lib/test/test_sys_settrace.py')
-rw-r--r--Lib/test/test_sys_settrace.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py
index 8e430f72f63..883b2842f2c 100644
--- a/Lib/test/test_sys_settrace.py
+++ b/Lib/test/test_sys_settrace.py
@@ -1403,6 +1403,25 @@ class TraceTestCase(unittest.TestCase):
(3, 'line'),
(3, 'return')])
+ def test_class_creation_with_docstrings(self):
+
+ def func():
+ class Class_1:
+ ''' the docstring. 2'''
+ def __init__(self):
+ ''' Another docstring. 4'''
+ self.a = 5
+
+ self.run_and_compare(func,
+ [(0, 'call'),
+ (1, 'line'),
+ (1, 'call'),
+ (1, 'line'),
+ (2, 'line'),
+ (3, 'line'),
+ (3, 'return'),
+ (1, 'return')])
+
class SkipLineEventsTraceTestCase(TraceTestCase):
"""Repeat the trace tests, but with per-line events skipped"""