pallets/jinja

test_striptags regressed with markupsafe 2.1.4

mweinelt opened this issue · 1 comments

After upgrading markupsafe to 2.1.4 in nixpkgs, we are seeing test_striptags fail. The comparison string seems to have gained a trailing space.

pallets/markupsafe#417

__________________________ TestFilter.test_striptags ___________________________

self = <test_filters.TestFilter object at 0x7ffff5795cd0>
env = <jinja2.environment.Environment object at 0x7ffff597a0d0>

    def test_striptags(self, env):
        tmpl = env.from_string("""{{ foo|striptags }}""")
        out = tmpl.render(
            foo='  <p>just a small   \n <a href="#">'
            "example</a> link</p>\n<p>to a webpage</p> "
            "<!-- <p>and some commented stuff</p> -->"
        )
>       assert out == "just a small example link to a webpage"
E       AssertionError: assert 'just a small...to a webpage ' == 'just a small... to a webpage'
E         - just a small example link to a webpage
E         + just a small example link to a webpage 
E         ?                                       +

tests/test_filters.py:101: AssertionError

Expectations

The issue seems to be in markupsafe, so maybe you want to exclude that version.

Reproducer

  • Upgrade markupsafe to 2.1.4
  • Run the test suite

Environment:

  • Python version: 3.11.7
  • Jinja version: 3.1.3

Already reported to MarkupSafe pallets/markupsafe#417