test_features.py
This file
Path
tests/test_features.py
16 lines · 377 bytes · Python
Last changed by
Added a test for generator_stopArmin Ronacherbefore adoption17f73a8
History of this fileTake it
Added a test for generator_stopArmin Ronacherbefore adoption17f73a8
lines 1–16why, one step back1import sys2import pytest34from jinja2 import Template567@pytest.mark.skipif(sys.version_info < (3, 5),8 reason='Requires 3.5 or later')9def test_generator_stop():10 class X(object):11 def __getattr__(self, name):12 raise StopIteration()1314 t = Template('a{{ bad.bar() }}b')15 with pytest.raises(RuntimeError):16 t.render(bad=X())