summaryrefslogtreecommitdiff
path: root/tests/test_api.py
Commit message (Collapse)AuthorAgeFilesLines
* unify/rename filter and function decoratorsDavid Lord2021-04-101-6/+6
| | | | Use pass_context instead of contextfilter and contextfunction, etc.
* Undefined.__contains__ raises UndefinedErrorDavid Parker2021-04-051-0/+1
|
* Setup mypyTeymour Aldridge2020-07-281-1/+1
| | | | | * 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
* Merge branch '2.11.x'David Lord2020-03-301-0/+15
|\
| * AttributeError in undefined message doesn't cause RuntimeErrorDavid Lord2020-03-271-0/+15
| |
* | Merge branch '2.11.x'David Lord2020-02-051-10/+0
|\ \ | |/
| * remove custom pytest marksDavid Lord2020-02-051-10/+0
| |
* | apply pyupgrade and f-stringsDavid Lord2020-02-051-29/+26
| |
* | remove more compat codeDavid Lord2020-02-051-1/+0
|/
* Revert "rename imports to jinja"David Lord2020-01-261-20/+20
| | | | This reverts commit 1167525b73863119f8bbec03ddb9d35eacff4bef.
* rename imports to jinjaDavid Lord2020-01-101-20/+20
|
* simplify module docstringsstyleDavid Lord2020-01-101-9/+0
|
* apply flake8David Lord2020-01-101-15/+4
|
* apply blackDavid Lord2020-01-101-131/+135
|
* apply reorder-python-importsDavid Lord2020-01-101-7/+15
|
* handle Undefined in get/select_templateDavid Lord2019-12-051-0/+25
|
* refactor visit_OutputDavid Lord2019-11-201-15/+15
| | | | | | | | | | | | * `finalize` is generated once and cached for all nodes. * Extract common behavior for native env. Removed the compiler behavior where groups of nodes would generate a format string. Instead, individual nodes are always yielded. This made rendering 30% faster in the examples, and simplifies the code. It also removes the issue where Python would report either the first or last line of the multi-line format expression, messing up the traceback line number mapping.
* Don't make cond_expr_undefined configurableAdrian Moennich2019-10-131-9/+1
|
* Use separate undefined object for CondExprAdrian Moennich2019-10-131-0/+9
|
* don't finalize TemplateData nodesno-finalize-template-dataDavid Lord2019-10-121-10/+47
| | | | | Finalize only applies to the output of expressions (constant or not). Add tests for context, eval, and env finalize functions.
* Replaced try...catch within tests with pytest.raisespytest-cleanupKevin Brown2019-10-101-10/+2
| | | | | | This still leaves one in test_debug which relies on reading out the traceback and cannot easily be replaced by pytest.raises like the others.
* Eliminate dead code by using pytests.raises instead of try/except/elsebtharper2019-10-061-5/+1
|
* Add tests for Undefined classesEtiennePelletier2019-10-041-0/+15
|
* Merge branch '2.10.x'David Lord2019-07-261-0/+9
|\
| * sandbox uses xrange on Python 2Prakhar Bhandari2019-07-221-1/+10
| |
* | exclude globals from find_undeclared_variablesBrendan2019-07-221-0/+4
| |
* | Add ChainableUndefined allowing getattr & getitem (#997)Étienne Pelletier2019-05-081-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* | Trim trailing white space throughout the projectJon Dufresne2018-08-291-1/+1
|/ | | | | | Many editors clean up trailing white space on save. By removing it all in one go, it helps keep future diffs cleaner by avoiding spurious white space changes on unrelated lines.
* Bump up the copyright to 2017Armin Ronacher2017-01-071-1/+1
|
* Cleaned up shitty syntax in testsuiteArmin Ronacher2017-01-061-5/+5
|
* Fixed various breakage from the new id trackingArmin Ronacher2017-01-031-1/+1
|
* Merge pull request #530 from nick-garcia/masterArmin Ronacher2017-01-031-0/+2
|\ | | | | Subtraction from Undefined does not raise UndefinedError
| * Setting __sub__ equal to _fail_with_undefined_error so subtractions withNick Garcia2016-01-071-0/+2
| | | | | | | | undefined variables will fail properly like other arithemtic operations.
* | Give Cycler a next() method so that it works in python2 and 3Matt Haggard2015-12-291-0/+11
|/
* Let the Environment override the ContextThiefMaster2015-04-061-0/+13
| | | | closes #404
* Let the Environment override the CodeGeneratorThiefMaster2015-04-061-0/+22
| | | | see #404
* Rename testsuite to tests and suggestionsKartheek Lenkala2015-03-221-0/+292
Remove py.test from setup.py install_requires Rename testsuite folder to tests.