summaryrefslogtreecommitdiff
path: root/test/test_templite.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-11-21 08:31:47 -0500
committerNed Batchelder <ned@nedbatchelder.com>2009-11-21 08:31:47 -0500
commit002c59c122f5a72868c9a3835f692968eb689b0a (patch)
tree6e071722d8bf388dd18d419fc5d7dadb564cb7de /test/test_templite.py
parent4108517952e9b96658d30dcb87ca098abbe14a14 (diff)
downloadpython-coveragepy-git-002c59c122f5a72868c9a3835f692968eb689b0a.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/test_templite.py')
-rw-r--r--test/test_templite.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/test_templite.py b/test/test_templite.py
index 8cb25865..6b445aa2 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()