blob: d2b68c75d00aac3743bc812332026e60c5dd0edd (
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())
|