Commit Graph

10 Commits

Author SHA1 Message Date
Teymour Aldridge
50ae5b6ac7 Setup mypy
* Add missing type hints (these are intended as an initial set of type hints, to be added upon and improved later)
* Setup MyPy to run as a Github Action
2020-07-28 22:32:34 +01:00
David Lord
719537aeec
don't finalize TemplateData nodes
Finalize only applies to the output of expressions (constant or not).
Add tests for context, eval, and env finalize functions.
2019-10-12 21:25:48 -07:00
Étienne Pelletier
19133d4059 Add ChainableUndefined allowing getattr & getitem (#997)
* Add ChainableUndefined allowing getattr & getitem

Allows using default values with chains of items or attributes that may
contain undefined values without raising a jinja2.exceptions.UndefinedError.

>>> import jinja2
>>> env = jinja2.Environment(undefined=jinja2.ChainableUndefined)
>>> env.from_string("{{ foo.bar['baz'] | default('val') }}").render()
'val'

* Remove class decorator from ChainableUndefined
2019-05-08 10:47:33 -04:00
Erik Johnson
8ef99c3d6a
Add .pytest_cache/ to gitignore 2018-03-19 16:03:29 -05:00
David Lord
8261ac0fb7
standard test configuration
add branch coverage and codecov
2017-07-06 11:07:02 -07:00
Armin Ronacher
a78bee7403 Updated gitignore to include venvs 2016-12-28 09:51:24 +01:00
David Lord
d760b78a2f standard tox/travis config
fix pytest warning, don't prefix non-testcase classes with Test
2016-04-11 16:18:24 -07:00
Armin Ronacher
25a67d0a14 Added .egg to .gitignore 2013-05-20 01:32:44 +01:00
Armin Ronacher
788fd1ccb3 Added .tox to .gitignore 2013-05-18 11:36:26 +01:00
Armin Ronacher
3dd4155f2d Updated ignore files 2010-10-17 16:02:17 +02:00