diff options
| author | Ned Batchelder <ned@nedbatchelder.com> | 2009-11-21 08:31:47 -0500 |
|---|---|---|
| committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-11-21 08:31:47 -0500 |
| commit | 6497a1f7a5d19ee31a6d7fb8552d308544980e2a (patch) | |
| tree | 892fdcd0f6fd73c3d877126ac79be4c1c86ee9ff /test | |
| parent | 4e7ebf2419893348dee1c38b2c33cafe5a92d23a (diff) | |
| download | python-coveragepy-6497a1f7a5d19ee31a6d7fb8552d308544980e2a.tar.gz | |
Add nicer exception reporting inside Templite so when a template goes wrong we have some hope of figuring out why.
Diffstat (limited to 'test')
| -rw-r--r-- | test/test_templite.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/test_templite.py b/test/test_templite.py index 8cb2586..6b445aa 100644 --- a/test/test_templite.py +++ b/test/test_templite.py @@ -191,6 +191,13 @@ class TempliteTest(unittest.TestCase): "@a0b0c0a1b1c1a2b2c2!" ) - + def test_exception(self): + # TypeError: Couldn't evaluate {{ foo.bar.baz }}: + # 'NoneType' object is unsubscriptable + self.assertRaises(TypeError, self.try_render, + "Hey {{foo.bar.baz}} there", {'foo': None}, "Hey XXX there" + ) + + if __name__ == '__main__': unittest.main() |
