Skip to content

Commit 16a789a

Browse files
committed
add class decorator test
1 parent 02c0780 commit 16a789a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_unit_eval.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,22 @@ class Foo(metaclass=Meta, flag=True):
206206
""",
207207
[True, True],
208208
],
209+
[
210+
"""
211+
def deco(label):
212+
def wrap(cls):
213+
cls.labels.append(label)
214+
return cls
215+
return wrap
216+
217+
@deco("first")
218+
@deco("second")
219+
class Decorated:
220+
labels = []
221+
Decorated.labels
222+
""",
223+
["second", "first"],
224+
],
209225
["Foo = [type('Foo', (), {'x': 100})]; Foo[0].x = 10; Foo[0].x", 10],
210226
["Foo = [type('Foo', (), {'x': [100, 101]})]; Foo[0].x[1] = 10; Foo[0].x", [100, 10]],
211227
["Foo = [type('Foo', (), {'x': [0, [[100, 101]]]})]; Foo[0].x[1][0][1] = 10; Foo[0].x[1]", [[100, 10]]],

0 commit comments

Comments
 (0)