aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/Jinja2/py2/tests/test_features.py
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-02-10 16:44:30 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:30 +0300
commit2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch)
tree012bb94d777798f1f56ac1cec429509766d05181 /contrib/python/Jinja2/py2/tests/test_features.py
parent6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff)
downloadydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/python/Jinja2/py2/tests/test_features.py')
-rw-r--r--contrib/python/Jinja2/py2/tests/test_features.py30
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 34b6f200de..1050458f45 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)