summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_inspect.py
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2017-01-02 03:59:12 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2017-01-02 03:59:12 (GMT)
commit01debaccdd1042ecff474637bd8905d6ec3efd60 (patch)
tree34b44a52f9f0c8c913435fa351fd99b2a173300e /Lib/test/test_inspect.py
parent5430293fdf286b33f2370d15705ee4339c81e82c (diff)
parentff0e3b7a54673791bb724be9679c85a4feb7468c (diff)
downloadcpython-01debaccdd1042ecff474637bd8905d6ec3efd60.zip
cpython-01debaccdd1042ecff474637bd8905d6ec3efd60.tar.gz
cpython-01debaccdd1042ecff474637bd8905d6ec3efd60.tar.bz2
Issue #15812: Merge from 3.5
Diffstat (limited to 'Lib/test/test_inspect.py')
-rw-r--r--Lib/test/test_inspect.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
index 97634e5..88eaabe 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -402,6 +402,11 @@ class TestRetrievingSourceCode(GetSourceBase):
# Check filename override
self.assertEqual(inspect.getmodule(None, modfile), mod)
+ def test_getframeinfo_get_first_line(self):
+ frame_info = inspect.getframeinfo(self.fodderModule.fr, 50)
+ self.assertEqual(frame_info.code_context[0], "# line 1\n")
+ self.assertEqual(frame_info.code_context[1], "'A module docstring.'\n")
+
def test_getsource(self):
self.assertSourceEqual(git.abuse, 29, 39)
self.assertSourceEqual(mod.StupidGit, 21, 51)