Fix an issue with omited dedents in the parser.

This commit is contained in:
Dave Halter
2015-02-05 00:09:16 +01:00
parent e1c623d3f3
commit dce952aec6
3 changed files with 53 additions and 29 deletions

View File

@@ -242,6 +242,21 @@ def test_one_statement_func():
cache.parser_cache.pop(None, None)
check_fp(src + 'def second():\n a', 3)
def test_class_func_if():
src = dedent("""\
class Class:
def func(self):
if 1:
a
else:
b
pass
""")
check_fp(src, 3)
def test_wrong_indentation():
src = dedent("""\
def func():