Fixed error message prints function decorators when using assert in Python 3.9 and above. (#9359)

This commit is contained in:
Yuval Shimon
2021-12-07 11:31:03 +02:00
committed by Bruno Oliveira
parent 85897eddc6
commit 9bfa02ea07
4 changed files with 20 additions and 0 deletions

View File

@@ -618,6 +618,19 @@ def something():
assert str(source) == "def func(): raise ValueError(42)"
def test_decorator() -> None:
s = """\
def foo(f):
pass
@foo
def bar():
pass
"""
source = getstatement(3, s)
assert "@foo" in str(source)
def XXX_test_expression_multiline() -> None:
source = """\
something