Skip to content

Commit 2c0ca37

Browse files
committed
Simplify tests of the types of descriptor access
1 parent e49a9f2 commit 2c0ca37

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

test-data/unit/check-classes.test

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -831,9 +831,7 @@ class A:
831831
@property
832832
def f(self) -> str: pass
833833
a = A() # type: A
834-
s = '' # type: str
835-
s = a.f
836-
a = a.f # E: Incompatible types in assignment (expression has type "str", variable has type "A")
834+
reveal_type(a.f) # E: Revealed type is 'builtins.str'
837835
[builtins fixtures/property.pyi]
838836

839837
[case testAssigningToReadOnlyProperty]
@@ -910,9 +908,7 @@ class A:
910908
f = D()
911909

912910
a = A() # type: A
913-
s = '' # type: str
914-
s = a.f
915-
a = a.f # E: Incompatible types in assignment (expression has type "str", variable has type "A")
911+
reveal_type(a.f) # E: Revealed type is 'builtins.str'
916912

917913
[case testSettingDataDescriptor]
918914
import typing

0 commit comments

Comments
 (0)