Commit Graph

30 Commits

Author SHA1 Message Date
Adam Englander
a3dce7bb64
fix type/lint/format findings 2025-05-28 10:08:39 -07:00
David Lord
5e2385ca0c
Merge branch '3.0.x' 2021-11-05 07:22:41 -07:00
Miro Hrončok
757756696c
Tests: Adapt expected traceback regexes for Python 3.11.0a1
Fixes https://github.com/pallets/jinja/issues/1526

Before:

      File ".../broken.html", line 2, in <module>
        {{ fail() }}
      File ".../test_debug.py", line 32, in <lambda>
        tmpl.render(fail=lambda: 1 / 0)
    ZeroDivisionError: division by zero

After:

      File ".../broken.html", line 2, in <module>
        {{ fail() }}
        ^^^^^^^^^^^^
      File ".../test_debug.py", line 32, in <lambda>
        tmpl.render(fail=lambda: 1 / 0)
                                 ~~^~~
    ZeroDivisionError: division by zero
2021-11-05 07:19:04 -07:00
Miro Hrončok
e32c985af3
Tests: Make "Traceback did not match" an actual f-string
Otherwise the failure looks like this:

    >       assert (
                m is not None
            ), "Traceback did not match:\n\n{''.join(tb)}\nexpected:\n{expected_tb}"
    E       AssertionError: Traceback did not match:
    E         
    E         {''.join(tb)}
    E         expected:
    E         {expected_tb}
    E       assert None is not None
2021-11-02 16:47:28 +01:00
David Lord
e08dadd220
Merge branch '2.11.x' 2020-02-05 20:39:04 -08:00
David Lord
dd5a0508c5
remove custom pytest marks 2020-02-05 20:23:47 -08:00
David Lord
2a8515d2e5
apply pyupgrade and f-strings 2020-02-05 08:44:15 -08:00
David Lord
4a59ac9514
Revert "rename imports to jinja"
This reverts commit 1167525b73.
2020-01-26 21:12:52 -08:00
David Lord
1167525b73
rename imports to jinja 2020-01-10 15:30:16 -08:00
David Lord
51c1c8efa6
simplify module docstrings 2020-01-10 13:42:02 -08:00
David Lord
bb6216ea30
apply flake8 2020-01-10 10:40:52 -08:00
David Lord
04c8787155
apply black 2020-01-10 07:54:39 -08:00
David Lord
d177eeb295
apply reorder-python-imports 2020-01-10 07:54:39 -08:00
Andrew Rabert
b23a0dec2d
TemplateSyntaxError can be pickled 2020-01-08 11:14:52 -08:00
David Lord
2b0d1ed921
TemplateSyntaxError from included template has source 2019-12-03 13:22:10 -08:00
David Lord
cfb789adc8
rewrite traceback rewriting support
Simplify the `jinja.debug` code.

On Python >= 3.7, `tb_next` is directly assignable. On PyPy, use
transparent proxies only if support is enabled. For cpython < 3.7, use
ctypes to set `tb_next`. Rewrite the ctypes code to use `py_object` and
`pythonapi.Py_IncRef`, which seems to avoid crashing on debug builds.

On Python 3, a rewritten `TemplateSyntaxError` would retain the frames
from the compiler functions for some reason. Clear these so the template
source is the last thing in the traceback.
2019-12-02 12:58:18 -08:00
Mr. Senko
a1588c6aae Add test for Template.get_corresponding_lineno()
this currently breaks with an exception inside Jinja
2017-01-29 13:29:00 +02:00
Adrian Moennich
04b30cdd5c Remove unused/duplicate imports 2017-01-09 00:21:45 +01:00
Armin Ronacher
bbe0a4174c Bump up the copyright to 2017 2017-01-07 16:17:14 +01:00
Armin Ronacher
bd32b37dd3 Changed behavior of local extraction 2017-01-03 23:45:29 +01:00
Armin Ronacher
9cd8d8e3b0 Fixed debug support locals for new behavior 2017-01-03 23:45:29 +01:00
Kartheek Lenkala
ee2cb97449 Rename testsuite to tests and suggestions
Remove  py.test from setup.py install_requires
Rename testsuite folder to tests.
2015-03-22 18:03:14 +05:30
Armin Ronacher
b36ddc9a97 Removed old testsuite.
--HG--
branch : trunk
2010-02-09 21:27:54 +01:00
Armin Ronacher
8e64adfc05 Improved test invokation. Picks up doctests within Jinja now, changed
doctests that just show usage that would not work on their own so that
they are standard code blocks now and do not disturb testing.

--HG--
branch : trunk
2010-02-07 02:00:11 +01:00
Armin Ronacher
42979eb9ff Got rid of py.testisms.
--HG--
branch : trunk
2009-07-26 11:08:50 +02:00
Rene Leonhardt
c7e6c6d2e5 Support nose framework for the whole test suite.
--HG--
branch : trunk
2009-04-20 23:08:53 +02:00
Armin Ronacher
d416a97260 Improved Jinja's debugging support by introducing "@internalcode" which marks code objects that are skipped on tracebacks. Also template errors are now translated as well to help the pylons debugger.
--HG--
branch : trunk
2009-02-24 22:58:00 +01:00
Armin Ronacher
62ccd1be3d Copyright switch to "The Jinja Team".
--HG--
branch : trunk
2009-01-04 14:26:19 +01:00
Armin Ronacher
ccae0559b4 Various cleanups and added custom cycler.
--HG--
branch : trunk
2008-10-05 23:08:58 +02:00
Armin Ronacher
5411ce72a7 even more tests, fixed severe bug with autoescaping.
--HG--
branch : trunk
2008-05-25 11:36:22 +02:00