Skip to content

Commit b664fba

Browse files
committed
Add new test case
1 parent 220cfde commit b664fba

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

mypyc/test-data/run-classes.test

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2504,7 +2504,7 @@ def test_final_attribute() -> None:
25042504
assert C.A == -1
25052505
assert C.a == [-1]
25062506

2507-
[case testClassWithFinalTypingAttribute]
2507+
[case testClassWithFinalDecorator]
25082508
from typing import final
25092509

25102510
@final
@@ -2515,7 +2515,28 @@ class C:
25152515
def test_class_final_attribute() -> None:
25162516
assert C().a() == 1
25172517

2518-
[case testClassWithFinalTypingAttributeInherited]
2518+
2519+
[case testClassWithFinalDecoratorCtor]
2520+
from typing import final
2521+
2522+
@final
2523+
class C:
2524+
def __init__(self) -> None:
2525+
self.a = 1
2526+
2527+
def b(self) -> int:
2528+
return 2
2529+
2530+
@property
2531+
def c(self) -> int:
2532+
return 3
2533+
2534+
def test_class_final_attribute() -> None:
2535+
assert C().a == 1
2536+
assert C().b() == 2
2537+
assert C().c == 3
2538+
2539+
[case testClassWithFinalDecoratorInheritedWithProperties]
25192540
from typing import final
25202541

25212542
class B:

0 commit comments

Comments
 (0)