diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2014-08-24 14:50:28 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2014-08-24 14:50:28 (GMT) |
commit | cdcafb78b22ec1cc677abbb2ce292db79279e221 (patch) | |
tree | ccf586cfa575fb1f8c67edb6a3ed7ea757bd4a8a /Lib/test/test_inspect.py | |
parent | 1fa36268cfdac3760de37859aa3ec1b5121248c5 (diff) | |
download | cpython-cdcafb78b22ec1cc677abbb2ce292db79279e221.zip cpython-cdcafb78b22ec1cc677abbb2ce292db79279e221.tar.gz cpython-cdcafb78b22ec1cc677abbb2ce292db79279e221.tar.bz2 |
Issue #16808: inspect.stack() now returns a named tuple instead of a tuple.
Patch by Daniel Shahaf.
Diffstat (limited to 'Lib/test/test_inspect.py')
-rw-r--r-- | Lib/test/test_inspect.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index 0452445..d746636 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -182,6 +182,14 @@ class TestInterpreterStack(IsTestBase): (modfile, 43, 'argue', [' spam(a, b, c)\n'], 0)) self.assertEqual(revise(*mod.st[3][1:]), (modfile, 39, 'abuse', [' self.argue(a, b, c)\n'], 0)) + # Test named tuple fields + record = mod.st[0] + self.assertIs(record.frame, mod.fr) + self.assertEqual(record.lineno, 16) + self.assertEqual(record.filename, mod.__file__) + self.assertEqual(record.function, 'eggs') + self.assertIn('inspect.stack()', record.code_context[0]) + self.assertEqual(record.index, 0) def test_trace(self): self.assertEqual(len(git.tr), 3) |