Skip to content

Commit

Permalink
SONARPY-2360 Add unit test case on S5655 when compared types has deco…
Browse files Browse the repository at this point in the history
…rators (#2173)
  • Loading branch information
maksim-grebeniuk-sonarsource authored and Seppli11 committed Nov 22, 2024
1 parent 1e0cfa1 commit e197518
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions python-checks/src/test/resources/checks/argumentType.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,14 @@ class EnumA(Enum):
C = 3

len(EnumA)

import dataclasses
@dataclasses.dataclass
class DecoratedDataClass:
x : int

def decorated_dataclass_expected(data: DecoratedDataClass): ...
data = dataclasses.replace(DecoratedDataClass(42))

# FP SONARPY-2359
decorated_dataclass_expected(data) # Noncompliant

0 comments on commit e197518

Please sign in to comment.