blob: c7c43e8b8438327c6b204a06df8bc1b361eddd4d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
import pytest
from jinja2 import Template
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())
|