diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
commit | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch) | |
tree | 64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/python/Jinja2/py2/tests/test_features.py | |
parent | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff) | |
download | ydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/python/Jinja2/py2/tests/test_features.py')
-rw-r--r-- | contrib/python/Jinja2/py2/tests/test_features.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/contrib/python/Jinja2/py2/tests/test_features.py b/contrib/python/Jinja2/py2/tests/test_features.py index 1050458f45..34b6f200de 100644 --- a/contrib/python/Jinja2/py2/tests/test_features.py +++ b/contrib/python/Jinja2/py2/tests/test_features.py @@ -1,42 +1,42 @@ import sys - + import pytest -from jinja2 import contextfilter -from jinja2 import Environment -from jinja2 import Template -from jinja2._compat import text_type +from jinja2 import contextfilter +from jinja2 import Environment +from jinja2 import Template +from jinja2._compat import text_type -@pytest.mark.skipif(sys.version_info < (3, 5), reason="Requires 3.5 or later") +@pytest.mark.skipif(sys.version_info < (3, 5), reason="Requires 3.5 or later") def test_generator_stop(): class X(object): def __getattr__(self, name): raise StopIteration() - t = Template("a{{ bad.bar() }}b") + t = Template("a{{ bad.bar() }}b") with pytest.raises(RuntimeError): t.render(bad=X()) -@pytest.mark.skipif(sys.version_info[0] > 2, reason="Feature only supported on 2.x") +@pytest.mark.skipif(sys.version_info[0] > 2, reason="Feature only supported on 2.x") def test_ascii_str(): @contextfilter def assert_func(context, value): - assert type(value) is context["expected_type"] + assert type(value) is context["expected_type"] env = Environment() - env.filters["assert"] = assert_func + env.filters["assert"] = assert_func - env.policies["compiler.ascii_str"] = False + env.policies["compiler.ascii_str"] = False t = env.from_string('{{ "foo"|assert }}') - t.render(expected_type=text_type) + t.render(expected_type=text_type) - env.policies["compiler.ascii_str"] = True + env.policies["compiler.ascii_str"] = True t = env.from_string('{{ "foo"|assert }}') t.render(expected_type=str) for val in True, False: - env.policies["compiler.ascii_str"] = val + env.policies["compiler.ascii_str"] = val t = env.from_string(u'{{ "\N{SNOWMAN}"|assert }}') - t.render(expected_type=text_type) + t.render(expected_type=text_type) |