Skip to content
Myr

Merge pull request #530 from nick-garcia/master

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Subtraction from Undefined does not raise UndefinedError

authored by Armin Ronacher · committed by GitHub · parents 61dc8d0, dd85761 · Browse files · 2 files+3 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+3 added−1 removed

  • tests:+2 added−0 removed
  • other:+1 added−1 removed

2 files+3 added−1 removed

modified:jinja2/runtime.py+1 added-1 removed
505 unmodified lines
506 __add__ = __radd__ = __mul__ = __rmul__ = __div__ = __rdiv__ = \507 __truediv__ = __rtruediv__ = __floordiv__ = __rfloordiv__ = \508 __mod__ = __rmod__ = __pos__ = __neg__ = __call__ = \509 __getitem__ = __lt__ = __le__ = __gt__ = __ge__ = __int__ = \510 __float__ = __complex__ = __pow__ = __rpow__ = \510 __float__ = __complex__ = __pow__ = __rpow__ = __sub__ = \511 _fail_with_undefined_error512513 def __eq__(self, other):514 return type(self) is type(other)
162 unmodified lines
modified:tests/test_api.py+2 added
253 unmodified lines
254 assert env.from_string('{{ missing is not defined }}').render() \255 == 'True'256 assert env.from_string('{{ foo.missing }}').render(foo=42) == ''257 assert env.from_string('{{ not missing }}').render() == 'True'258 pytest.raises(UndefinedError,259 env.from_string('{{ missing - 1}}').render)260261 def test_debug_undefined(self):262 env = Environment(undefined=DebugUndefined)263 assert env.from_string('{{ missing }}').render() == '{{ missing }}'
77 unmodified lines