iter_return_stmts should also return return statements without a value.

This commit is contained in:
Dave Halter
2017-09-02 12:32:32 +02:00
parent 9ab5937a3c
commit e79c0755eb
3 changed files with 25 additions and 3 deletions

View File

@@ -140,3 +140,12 @@ def test_yields(each_version):
def test_yield_from():
y, = get_yield_exprs('def x(): (yield from 1)', '3.3')
assert y.type == 'yield_expr'
def test_returns():
r, = get_return_stmts('def x(): return')
assert r.value == 'return'
assert r.type == 'keyword'
r, = get_return_stmts('def x(): return 1')
assert r.type == 'return_stmt'