Method
test_else_loop_bug
tests/test_regression.py:282–292
· tests/test_regression.py::TestBug.test_else_loop_bug
(self, env)
Source from the content-addressed store, hash-verified
| 280 | ) |
| 281 | |
| 282 | def test_else_loop_bug(self, env): |
| 283 | t = Template( |
| 284 | class="st">""" |
| 285 | {% for x in y %} |
| 286 | {{ loop.index0 }} |
| 287 | {% else %} |
| 288 | {% for i in range(3) %}{{ i }}{% endfor %} |
| 289 | {% endfor %} |
| 290 | class="st">""" |
| 291 | ) |
| 292 | assert t.render(y=[]).strip() == class="st">"012" |
| 293 | |
| 294 | def test_correct_prefix_loader_name(self, env): |
| 295 | env = Environment(loader=PrefixLoader({class="st">"foo": DictLoader({})})) |
Callers
nothing calls this directly
Tested by
no test coverage detected