summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/coverage_coverage.py3
-rw-r--r--test/test_templite.py7
2 files changed, 8 insertions, 2 deletions
diff --git a/test/coverage_coverage.py b/test/coverage_coverage.py
index 1a5cc9c4..e1e7674f 100644
--- a/test/coverage_coverage.py
+++ b/test/coverage_coverage.py
@@ -8,7 +8,7 @@ HTML_DIR = "htmlcov"
if os.path.exists(HTML_DIR):
shutil.rmtree(HTML_DIR)
-cov = coverage.coverage()
+cov = coverage.coverage(branch=True)
# Cheap trick: the coverage code itself is excluded from measurement, but if
# we clobber the cover_prefix in the coverage object, we can defeat the
# self-detection.
@@ -40,5 +40,6 @@ cov.clear_exclude()
cov.exclude("#pragma: no cover")
cov.exclude("def __repr__")
cov.exclude("if __name__ == .__main__.:")
+cov.exclude("raise AssertionError")
cov.html_report(directory=HTML_DIR, ignore_errors=True)
diff --git a/test/test_templite.py b/test/test_templite.py
index 6b445aa2..f2c20f94 100644
--- a/test/test_templite.py
+++ b/test/test_templite.py
@@ -191,13 +191,18 @@ class TempliteTest(unittest.TestCase):
"@a0b0c0a1b1c1a2b2c2!"
)
- def test_exception(self):
+ def test_exception_during_evaluation(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"
)
+ def test_bogus_tag_syntax(self):
+ self.assertRaises(SyntaxError, self.try_render,
+ "Huh: {% bogus %}!!{% endbogus %}??", {}, ""
+ )
+
if __name__ == '__main__':
unittest.main()