

def test_loop_errors(self):
    tmpl = env.from_string('{% for item in [1] if loop.index\n                                      == 0 %}...{% endfor %}')
    tmpl.assert_raises(UndefinedError, tmpl.render)
    tmpl = env.from_string('{% for item in [] %}...{% else\n            %}{{ loop }}{% endfor %}')
    assert (tmpl.render() == '')

dataset/ETHPy150Open GeekTrainer/Flask/Work/Trivia - Module 5/env/Lib/site-packages/jinja2/testsuite/core_tags.py ForLoopTestCase.test_loop_errors/VarMisuse@19/56 `self`->`tmpl`