node.filename)
assert node.flags != 'OP_DELETE', 'wtf? do we support that?'
if node.subs[0].__class__ is ast.Sliceobj:
- return '%s[%s]' % (
+ return '%s%s' % (
self.handle_node(node.expr),
self.handle_node(node.subs[0])
)
{{ while }}
{{ pass }}
{{ finally }}'''
+LIGHTKW = '''{{ call }}'''
UNPACKING = '''{% for a, b, c in [[1, 2, 3]] %}{{ a }}|{{ b }}|{{ c }}{% endfor %}'''
RAW = '''{% raw %}{{ FOO }} and {% BAR %}{% endraw %}'''
CALL = '''{{ foo('a', c='d', e='f', *['b'], **{'g': 'h'}) }}'''
-
def test_keywords(env):
env.from_string(KEYWORDS)
+def test_lightkw(env):
+ env.from_string(LIGHTKW)
+
+
def test_unpacking(env):
tmpl = env.from_string(UNPACKING)
assert tmpl.render() == '1|2|3'