Message179100
| Author |
meador.inge |
| Recipients |
danielsh, meador.inge, rhettinger, terry.reedy |
| Date |
2013年01月05日.02:18:43 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1357352324.21.0.691840457754.issue16808@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I suppose asserting the type wouldn't hurt, but I don't consider it that important:
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -164,12 +164,16 @@ class TestInterpreterStack(IsTestBase):
self.assertTrue(len(mod.st) >= 5)
self.assertEqual(revise(*mod.st[0][1:]),
(modfile, 16, 'eggs', [' st = inspect.stack()\n'], 0))
+ self.assertIsInstance(mod.st[0], inspect.FrameInfo)
self.assertEqual(revise(*mod.st[1][1:]),
(modfile, 9, 'spam', [' eggs(b + d, c + f)\n'], 0))
+ self.assertIsInstance(mod.st[1], inspect.FrameInfo)
self.assertEqual(revise(*mod.st[2][1:]),
(modfile, 43, 'argue', [' spam(a, b, c)\n'], 0))
+ self.assertIsInstance(mod.st[2], inspect.FrameInfo)
self.assertEqual(revise(*mod.st[3][1:]),
(modfile, 39, 'abuse', [' self.argue(a, b, c)\n'], 0))
+ self.assertIsInstance(mod.st[3], inspect.FrameInfo)
TestGetClosureVars builds the named tuples directly and compares them. For example:
expected = inspect.ClosureVars(nonlocal_vars, global_vars,
builtin_vars, unbound_names)
self.assertEqual(inspect.getclosurevars(f(_arg)), expected)
Doing this for FrameInfo is awkward because we don't have a frame object to construct
the named tuple with. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2013年01月05日 02:18:44 | meador.inge | set | recipients:
+ meador.inge, rhettinger, terry.reedy, danielsh |
| 2013年01月05日 02:18:44 | meador.inge | set | messageid: <1357352324.21.0.691840457754.issue16808@psf.upfronthosting.co.za> |
| 2013年01月05日 02:18:44 | meador.inge | link | issue16808 messages |
| 2013年01月05日 02:18:43 | meador.inge | create |
|