summaryrefslogtreecommitdiff
path: root/tests/test_features.py
diff options
context:
space:
mode:
authorDavid Lord <davidism@gmail.com>2020-01-10 07:46:18 -0800
committerDavid Lord <davidism@gmail.com>2020-01-10 07:54:39 -0800
commit04c8787155137206d58d6ee147d06482c1a8b598 (patch)
tree3d0abf84d0296a15fdd949bcbf8570ae4b93d912 /tests/test_features.py
parentd177eeb295e2552227bf569d703ca32bb509a628 (diff)
downloadjinja2-04c8787155137206d58d6ee147d06482c1a8b598.tar.gz
apply black
Diffstat (limited to 'tests/test_features.py')
-rw-r--r--tests/test_features.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/tests/test_features.py b/tests/test_features.py
index d9ee4e5..0d7baed 100644
--- a/tests/test_features.py
+++ b/tests/test_features.py
@@ -7,37 +7,35 @@ from jinja2 import Environment
from jinja2 import Template
-@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=unicode)
- 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=unicode)