mirror of
https://github.com/davidhalter/parso.git
synced 2026-10-01 07:23:46 +08:00
iter_return_stmts should also return return statements without a value.
This commit is contained in:
1 parent
9ab5937a3c
commit
e79c0755eb
3 files changed
+25
-3
No files matched your search
@@ -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'
|
||||
Reference in new issue
Block a user