MCPcopy
hub / github.com/pallets/jinja / test_stopiteration_is_undefined

Method test_stopiteration_is_undefined

tests/test_api.py:257–264  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

255
256class TestUndefined:
257 def test_stopiteration_is_undefined(self):
258 def test():
259 raise StopIteration()
260
261 t = Template("A{{ test() }}B")
262 assert t.render(test=test) == "AB"
263 t = Template("A{{ test().missingattribute }}B")
264 pytest.raises(UndefinedError, t.render, test=test)
265
266 def test_undefined_and_special_attributes(self):
267 with pytest.raises(AttributeError):

Callers

nothing calls this directly

Calls 2

renderMethod · 0.95
TemplateClass · 0.90

Tested by

no test coverage detected