diff options
| author | Benjamin Peterson <benjamin@python.org> | 2017-01-01 22:09:18 -0600 |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2017-01-01 22:09:18 -0600 |
| commit | eb62be12f05cfce17f09709b4340a8a24dd0a1b5 (patch) | |
| tree | 8143b6abb631bd26ab8750cdc0737d2e9d585201 /Lib/test | |
| parent | 5848e72ee1f85354b023b19b83c88ba57d39b6d0 (diff) | |
| parent | 01debaccdd1042ecff474637bd8905d6ec3efd60 (diff) | |
| download | cpython-git-eb62be12f05cfce17f09709b4340a8a24dd0a1b5.tar.gz | |
merge heads
Diffstat (limited to 'Lib/test')
| -rw-r--r-- | Lib/test/test_inspect.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index 97634e591c..88eaabe676 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) |
