summaryrefslogtreecommitdiff
path: root/tests/test_features.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_features.py')
-rw-r--r--tests/test_features.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_features.py b/tests/test_features.py
new file mode 100644
index 0000000..25d58e4
--- /dev/null
+++ b/tests/test_features.py
@@ -0,0 +1,16 @@
+import sys
+import pytest
+
+from jinja2 import Template
+
+
+@pytest.mark.skipif(sys.version_info < (3, 5),
+ reason='Requires 3.5 or later')
+def test_generator_stop():
+ class X(object):
+ def __getattr__(self, name):
+ raise StopIteration()
+
+ t = Template('a{{ bad.bar() }}b')
+ with pytest.raises(RuntimeError):
+ t.render(bad=X())