File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff 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 ]
25082508from typing import final
25092509
25102510@final
@@ -2515,7 +2515,28 @@ class C:
25152515def 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]
25192540from typing import final
25202541
25212542class B:
You can’t perform that action at this time.
0 commit comments