Skip to content

Commit

Permalink
Add test cases for method property overrides (#13503)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilevkivskyi authored Aug 25, 2022
1 parent 9431d47 commit a56fcac
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test-data/unit/check-classes.test
Original file line number Diff line number Diff line change
Expand Up @@ -7457,3 +7457,23 @@ class Bar(Foo):
@x.setter
def x(self, value: int) -> None: ...
[builtins fixtures/property.pyi]

[case testOverrideMethodProperty]
class B:
def foo(self) -> int:
...
class C(B):
@property
def foo(self) -> int: # E: Signature of "foo" incompatible with supertype "B"
...
[builtins fixtures/property.pyi]

[case testOverridePropertyMethod]
class B:
@property
def foo(self) -> int:
...
class C(B):
def foo(self) -> int: # E: Signature of "foo" incompatible with supertype "B"
...
[builtins fixtures/property.pyi]

0 comments on commit a56fcac

Please sign in to comment.