Skip to content
Myr

Added a test for generator_stop

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 61f39a9 · Browse files · 1 file+16 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+16 added−0 removed

  • tests:+16 added−0 removed

1 file+16 added−0 removed

added:tests/test_features.py+16 added
1import 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())