-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for existing Pyreverse bugs (#8983)
* Add Pyreverse bug tests * Sort Pyreverse class diagram names * Add test for bad line break
- Loading branch information
Showing
8 changed files
with
75 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
tests/pyreverse/functional/class_diagrams/annotations/line_breaks.dot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
digraph "classes" { | ||
rankdir=BT | ||
charset="utf-8" | ||
"line_breaks.A" [color="black", fontcolor="black", label=<{A|<br ALIGN="LEFT"/>|<I>f</I>(x: str | None)<br ALIGN="LEFT"/>}>, shape="record", style="solid"]; | ||
} |
4 changes: 4 additions & 0 deletions
4
tests/pyreverse/functional/class_diagrams/annotations/line_breaks.mmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
classDiagram | ||
class A { | ||
f(x: str | None)* | ||
} |
6 changes: 6 additions & 0 deletions
6
tests/pyreverse/functional/class_diagrams/annotations/line_breaks.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@startuml classes | ||
set namespaceSeparator none | ||
class "A" as line_breaks.A { | ||
{abstract}f(x: str | None) | ||
} | ||
@enduml |
5 changes: 5 additions & 0 deletions
5
tests/pyreverse/functional/class_diagrams/annotations/line_breaks.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# OPEN BUG: https://github.com/pylint-dev/pylint/issues/8671 | ||
|
||
class A: | ||
def f(self, x: str | None): | ||
pass |
2 changes: 2 additions & 0 deletions
2
tests/pyreverse/functional/class_diagrams/annotations/line_breaks.rc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[testoptions] | ||
output_formats=mmd,dot,puml |
20 changes: 20 additions & 0 deletions
20
tests/pyreverse/functional/class_diagrams/attributes/duplicates.mmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
classDiagram | ||
class A { | ||
} | ||
class DuplicateAnnotations { | ||
lav : list, list[str] | ||
val : str, str | int | ||
bar() None | ||
} | ||
class DuplicateArrows { | ||
a | ||
a | ||
} | ||
class DuplicateFields { | ||
example1 : int | ||
example1 : int | ||
example2 : int | ||
example2 : int | ||
} | ||
A --* DuplicateArrows : a | ||
A --* DuplicateArrows : a |
31 changes: 31 additions & 0 deletions
31
tests/pyreverse/functional/class_diagrams/attributes/duplicates.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# OPEN BUG: https://github.com/pylint-dev/pylint/issues/8189 | ||
class DuplicateFields(): | ||
example1: int | ||
example2: int | ||
|
||
def __init__(self): | ||
self.example1 = 1 | ||
self.example2 = 2 | ||
|
||
|
||
# OPEN BUG: https://github.com/pylint-dev/pylint/issues/8522 | ||
class A: | ||
pass | ||
|
||
class DuplicateArrows: | ||
a: A | ||
|
||
def __init__(self): | ||
self.a = A() | ||
|
||
|
||
|
||
# OPEN BUG: https://github.com/pylint-dev/pylint/issues/8888 | ||
class DuplicateAnnotations: | ||
def __init__(self) -> None: | ||
self.val: str | int = "1" | ||
self.lav: list[str] = [] | ||
|
||
def bar(self) -> None: | ||
self.val = "2" | ||
self.lav = [] |