aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/Jinja2/py3/tests/test_features.py
blob: 4f36458a7f9b8e72cb0d8457214f6a754baf7d07 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import pytest

from jinja2 import Template


# Python < 3.7
def test_generator_stop():
    class X:
        def __getattr__(self, name):
            raise StopIteration()

    t = Template("a{{ bad.bar() }}b")
    with pytest.raises(RuntimeError):
        t.render(bad=X())