aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/Jinja2/py3/tests/test_features.py
blob: c8184c1592ea7b5ae319adc8787686339a2bccda (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())