summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2017-01-02 04:09:07 (GMT)
committerBenjamin Peterson <benjamin@python.org>2017-01-02 04:09:07 (GMT)
commitc9d4c60a562f66ca73509ef682e88a1726b860f8 (patch)
tree688674287d981d2b133c2bcf90956ba5fdf18c2c /Lib/test
parent4365833d11fb8e0139d9e8a543692e963a749e38 (diff)
parentff0e3b7a54673791bb724be9679c85a4feb7468c (diff)
downloadcpython-c9d4c60a562f66ca73509ef682e88a1726b860f8.zip
cpython-c9d4c60a562f66ca73509ef682e88a1726b860f8.tar.gz
cpython-c9d4c60a562f66ca73509ef682e88a1726b860f8.tar.bz2
merge heads
Diffstat (limited to 'Lib/test')
-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 671e05a..d33de9e 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -391,6 +391,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)