Fixed error message prints function decorators when using assert in Python 3.9 and above. (#9359)
This commit is contained in:
committed by
Bruno Oliveira
parent
85897eddc6
commit
9bfa02ea07
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user