diff options
| author | Benjamin Peterson <benjamin@python.org> | 2017-01-01 22:09:30 -0600 |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2017-01-01 22:09:30 -0600 |
| commit | e953a7237668e03b698ca5d241329cc7147c2040 (patch) | |
| tree | 306179651c2f5eb32e085c46142d7f037b14568c /Lib/test | |
| parent | 6784be1d00c700fce08fd35ce94f0696dedbe493 (diff) | |
| parent | 6215e524a2453c4c4d4e452ba90e8f37de5df5db (diff) | |
| download | cpython-git-e953a7237668e03b698ca5d241329cc7147c2040.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 1be9a125fa..9d9fedc21e 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -399,6 +399,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) |
