diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-01-09 20:10:23 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-01-09 20:10:23 -0500 |
commit | 35fda609e4dc07d0b6d47deb8746eec3ac3729b4 (patch) | |
tree | cdf93373577dfeb584df4bde479e660abf7bfb34 /tests/test_templite.py | |
parent | 70348a1a6e422cf271e432319b24fb66d30d1559 (diff) | |
download | python-coveragepy-35fda609e4dc07d0b6d47deb8746eec3ac3729b4.tar.gz |
Report a more useful error if an expression fails.
Diffstat (limited to 'tests/test_templite.py')
-rw-r--r-- | tests/test_templite.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_templite.py b/tests/test_templite.py index aca848a..2b64e4e 100644 --- a/tests/test_templite.py +++ b/tests/test_templite.py @@ -3,7 +3,7 @@ import re -from coverage.templite import Templite, TempliteSyntaxError +from coverage.templite import Templite, TempliteSyntaxError, TempliteValueError from tests.coveragetest import CoverageTest @@ -244,8 +244,8 @@ class TempliteTest(CoverageTest): def test_exception_during_evaluation(self): # TypeError: Couldn't evaluate {{ foo.bar.baz }}: - # 'NoneType' object is unsubscriptable - with self.assertRaises(TypeError): + msg = "Couldn't evaluate None.bar" + with self.assertRaisesRegex(TempliteValueError, msg): self.try_render( "Hey {{foo.bar.baz}} there", {'foo': None}, "Hey ??? there" ) |