summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_inspect.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2017-01-02 04:09:18 (GMT)
committerBenjamin Peterson <benjamin@python.org>2017-01-02 04:09:18 (GMT)
commiteb62be12f05cfce17f09709b4340a8a24dd0a1b5 (patch)
tree8143b6abb631bd26ab8750cdc0737d2e9d585201 /Lib/test/test_inspect.py
parent5848e72ee1f85354b023b19b83c88ba57d39b6d0 (diff)
parent01debaccdd1042ecff474637bd8905d6ec3efd60 (diff)
downloadcpython-eb62be12f05cfce17f09709b4340a8a24dd0a1b5.zip
cpython-eb62be12f05cfce17f09709b4340a8a24dd0a1b5.tar.gz
cpython-eb62be12f05cfce17f09709b4340a8a24dd0a1b5.tar.bz2
merge heads
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)