Skip to content

Commit c141cdf

Browse files
authored
Small improvements to the conformance tests (#2061)
1 parent d4f39b2 commit c141cdf

12 files changed

+56
-59
lines changed

conformance/results/mypy/aliases_recursive.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ aliases_recursive.py:38: error: Incompatible types in assignment (expression has
66
aliases_recursive.py:39: error: Name "t6" already defined on line 38 [no-redef]
77
aliases_recursive.py:50: error: Dict entry 0 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, RecursiveMapping]" [dict-item]
88
aliases_recursive.py:51: error: Dict entry 2 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, RecursiveMapping]" [dict-item]
9-
aliases_recursive.py:52: error: Dict entry 2 has incompatible type "str": "dict[str, str | int | list[int]]"; expected "str": "str | int | Mapping[str, RecursiveMapping]" [dict-item]
9+
aliases_recursive.py:52: error: Dict entry 2 has incompatible type "str": "list[int]"; expected "str": "str | int | Mapping[str, RecursiveMapping]" [dict-item]
1010
aliases_recursive.py:63: error: List item 0 has incompatible type "float"; expected "GenericTypeAlias1[str] | str" [list-item]
1111
aliases_recursive.py:69: error: List item 0 has incompatible type "float"; expected "GenericTypeAlias2[str, int] | str | int" [list-item]
1212
aliases_recursive.py:72: error: Invalid recursive alias: a union item of itself [misc]

conformance/results/mypy/annotations_generators.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,5 @@ annotations_generators.py:119: error: Incompatible types in "yield from" (actual
1616
"""
1717
conformance_automated = "Fail"
1818
errors_diff = """
19-
Line 87: Expected 1 errors
20-
Line 92: Expected 1 errors
2119
Line 135: Expected 1 errors
2220
"""

conformance/results/mypy/dataclasses_transform_func.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ Does not handle `kw_only=False` override when `kw_only_default=True`.
44
Does not report error when `order=False` and comparison operators are used.
55
"""
66
output = """
7-
dataclasses_transform_func.py:53: error: Too many positional arguments for "Customer1" [misc]
8-
dataclasses_transform_func.py:57: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment]
9-
dataclasses_transform_func.py:65: error: Unexpected keyword argument "salary" for "Customer1" [call-arg]
10-
dataclasses_transform_func.py:71: error: Too many positional arguments for "Customer2" [misc]
11-
dataclasses_transform_func.py:90: error: Non-frozen dataclass cannot inherit from a frozen dataclass [misc]
12-
dataclasses_transform_func.py:97: error: Property "id" defined in "Customer3" is read-only [misc]
7+
dataclasses_transform_func.py:52: error: Too many positional arguments for "Customer1" [misc]
8+
dataclasses_transform_func.py:56: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment]
9+
dataclasses_transform_func.py:64: error: Unexpected keyword argument "salary" for "Customer1" [call-arg]
10+
dataclasses_transform_func.py:70: error: Too many positional arguments for "Customer2" [misc]
11+
dataclasses_transform_func.py:89: error: Non-frozen dataclass cannot inherit from a frozen dataclass [misc]
12+
dataclasses_transform_func.py:96: error: Property "id" defined in "Customer3" is read-only [misc]
1313
"""
1414
conformance_automated = "Fail"
1515
errors_diff = """
16-
Line 61: Expected 1 errors
17-
Line 53: Unexpected errors ['dataclasses_transform_func.py:53: error: Too many positional arguments for "Customer1" [misc]']
16+
Line 60: Expected 1 errors
17+
Line 52: Unexpected errors ['dataclasses_transform_func.py:52: error: Too many positional arguments for "Customer1" [misc]']
1818
"""

conformance/results/mypy/version.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = "mypy 1.17.0"
2-
test_duration = 1.9
1+
version = "mypy 1.17.1"
2+
test_duration = 2.8

conformance/results/pyre/dataclasses_transform_func.toml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,37 @@ Does not detect non-frozen class inheriting from frozen class.
55
Emits "attribute not initialized" error for dataclass field.
66
"""
77
output = """
8-
dataclasses_transform_func.py:25:5 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters.
9-
dataclasses_transform_func.py:29:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
10-
dataclasses_transform_func.py:35:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer1` to have type `int` but is never initialized.
11-
dataclasses_transform_func.py:36:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer1` to have type `str` but is never initialized.
12-
dataclasses_transform_func.py:41:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer2` to have type `int` but is never initialized.
13-
dataclasses_transform_func.py:42:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer2` to have type `str` but is never initialized.
14-
dataclasses_transform_func.py:47:4 Uninitialized attribute [13]: Attribute `salary` is declared in class `Customer2Subclass` to have type `float` but is never initialized.
15-
dataclasses_transform_func.py:50:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.
16-
dataclasses_transform_func.py:53:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided.
17-
dataclasses_transform_func.py:57:0 Incompatible attribute type [8]: Attribute `name` declared in class `Customer1` has type `str` but is used as type `int`.
18-
dataclasses_transform_func.py:61:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`.
19-
dataclasses_transform_func.py:65:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.
20-
dataclasses_transform_func.py:67:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.
21-
dataclasses_transform_func.py:71:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided.
22-
dataclasses_transform_func.py:73:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`.
23-
dataclasses_transform_func.py:91:4 Uninitialized attribute [13]: Attribute `age` is declared in class `Customer3Subclass` to have type `int` but is never initialized.
24-
dataclasses_transform_func.py:97:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`.
8+
dataclasses_transform_func.py:19:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
9+
dataclasses_transform_func.py:24:5 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters.
10+
dataclasses_transform_func.py:34:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer1` to have type `int` but is never initialized.
11+
dataclasses_transform_func.py:35:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer1` to have type `str` but is never initialized.
12+
dataclasses_transform_func.py:40:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer2` to have type `int` but is never initialized.
13+
dataclasses_transform_func.py:41:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer2` to have type `str` but is never initialized.
14+
dataclasses_transform_func.py:46:4 Uninitialized attribute [13]: Attribute `salary` is declared in class `Customer2Subclass` to have type `float` but is never initialized.
15+
dataclasses_transform_func.py:49:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.
16+
dataclasses_transform_func.py:52:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided.
17+
dataclasses_transform_func.py:56:0 Incompatible attribute type [8]: Attribute `name` declared in class `Customer1` has type `str` but is used as type `int`.
18+
dataclasses_transform_func.py:60:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`.
19+
dataclasses_transform_func.py:64:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.
20+
dataclasses_transform_func.py:66:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.
21+
dataclasses_transform_func.py:70:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided.
22+
dataclasses_transform_func.py:72:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`.
23+
dataclasses_transform_func.py:90:4 Uninitialized attribute [13]: Attribute `age` is declared in class `Customer3Subclass` to have type `int` but is never initialized.
24+
dataclasses_transform_func.py:96:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`.
2525
"""
2626
conformance_automated = "Fail"
2727
errors_diff = """
28-
Lines 89, 90: Expected error (tag 'Customer3Subclass')
29-
Line 25: Unexpected errors ["dataclasses_transform_func.py:25:5 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."]
30-
Line 29: Unexpected errors ['dataclasses_transform_func.py:29:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).']
31-
Line 35: Unexpected errors ['dataclasses_transform_func.py:35:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer1` to have type `int` but is never initialized.']
32-
Line 36: Unexpected errors ['dataclasses_transform_func.py:36:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer1` to have type `str` but is never initialized.']
33-
Line 41: Unexpected errors ['dataclasses_transform_func.py:41:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer2` to have type `int` but is never initialized.']
34-
Line 42: Unexpected errors ['dataclasses_transform_func.py:42:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer2` to have type `str` but is never initialized.']
35-
Line 47: Unexpected errors ['dataclasses_transform_func.py:47:4 Uninitialized attribute [13]: Attribute `salary` is declared in class `Customer2Subclass` to have type `float` but is never initialized.']
36-
Line 50: Unexpected errors ['dataclasses_transform_func.py:50:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.']
37-
Line 53: Unexpected errors ['dataclasses_transform_func.py:53:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided.']
38-
Line 67: Unexpected errors ['dataclasses_transform_func.py:67:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.']
39-
Line 73: Unexpected errors ['dataclasses_transform_func.py:73:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`.']
40-
Line 91: Unexpected errors ['dataclasses_transform_func.py:91:4 Uninitialized attribute [13]: Attribute `age` is declared in class `Customer3Subclass` to have type `int` but is never initialized.']
28+
Lines 88, 89: Expected error (tag 'Customer3Subclass')
29+
Line 19: Unexpected errors ['dataclasses_transform_func.py:19:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).']
30+
Line 24: Unexpected errors ["dataclasses_transform_func.py:24:5 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."]
31+
Line 34: Unexpected errors ['dataclasses_transform_func.py:34:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer1` to have type `int` but is never initialized.']
32+
Line 35: Unexpected errors ['dataclasses_transform_func.py:35:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer1` to have type `str` but is never initialized.']
33+
Line 40: Unexpected errors ['dataclasses_transform_func.py:40:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer2` to have type `int` but is never initialized.']
34+
Line 41: Unexpected errors ['dataclasses_transform_func.py:41:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer2` to have type `str` but is never initialized.']
35+
Line 46: Unexpected errors ['dataclasses_transform_func.py:46:4 Uninitialized attribute [13]: Attribute `salary` is declared in class `Customer2Subclass` to have type `float` but is never initialized.']
36+
Line 49: Unexpected errors ['dataclasses_transform_func.py:49:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.']
37+
Line 52: Unexpected errors ['dataclasses_transform_func.py:52:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided.']
38+
Line 66: Unexpected errors ['dataclasses_transform_func.py:66:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.']
39+
Line 72: Unexpected errors ['dataclasses_transform_func.py:72:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`.']
40+
Line 90: Unexpected errors ['dataclasses_transform_func.py:90:4 Uninitialized attribute [13]: Attribute `age` is declared in class `Customer3Subclass` to have type `int` but is never initialized.']
4141
"""

conformance/results/pyre/version.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
version = "pyre 0.9.25"
2-
test_duration = 7.4
2+
test_duration = 5.4

conformance/results/pyright/dataclasses_transform_func.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
conformant = "Pass"
22
output = """
3-
dataclasses_transform_func.py:57:13 - error: Cannot assign to attribute "name" for class "Customer1"
3+
dataclasses_transform_func.py:56:13 - error: Cannot assign to attribute "name" for class "Customer1"
44
  "Literal[3]" is not assignable to "str" (reportAttributeAccessIssue)
5-
dataclasses_transform_func.py:61:6 - error: Operator "<" not supported for types "Customer1" and "Customer1" (reportOperatorIssue)
6-
dataclasses_transform_func.py:65:36 - error: No parameter named "salary" (reportCallIssue)
7-
dataclasses_transform_func.py:71:18 - error: Expected 0 positional arguments (reportCallIssue)
8-
dataclasses_transform_func.py:89:1 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues)
9-
dataclasses_transform_func.py:97:6 - error: Cannot assign to attribute "id" for class "Customer3"
5+
dataclasses_transform_func.py:60:6 - error: Operator "<" not supported for types "Customer1" and "Customer1" (reportOperatorIssue)
6+
dataclasses_transform_func.py:64:36 - error: No parameter named "salary" (reportCallIssue)
7+
dataclasses_transform_func.py:70:18 - error: Expected 0 positional arguments (reportCallIssue)
8+
dataclasses_transform_func.py:88:1 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues)
9+
dataclasses_transform_func.py:96:6 - error: Cannot assign to attribute "id" for class "Customer3"
1010
  Attribute "id" is read-only (reportAttributeAccessIssue)
1111
"""
1212
conformance_automated = "Pass"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
version = "pyright 1.1.403"
2-
test_duration = 1.4
2+
test_duration = 4.3

conformance/results/results.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,14 @@ <h3>Python Type System Conformance Test Results</h3>
158158
</header>
159159
<div class="table_container"><table><tbody>
160160
<tr><th class="col1">&nbsp;</th>
161-
<th class='tc-header'><div class='tc-name'>mypy 1.17.0</div>
162-
<div class='tc-time'>1.9sec</div>
161+
<th class='tc-header'><div class='tc-name'>mypy 1.17.1</div>
162+
<div class='tc-time'>2.8sec</div>
163163
</th>
164164
<th class='tc-header'><div class='tc-name'>pyright 1.1.403</div>
165-
<div class='tc-time'>1.4sec</div>
165+
<div class='tc-time'>4.3sec</div>
166166
</th>
167167
<th class='tc-header'><div class='tc-name'>pyre 0.9.25</div>
168-
<div class='tc-time'>7.4sec</div>
168+
<div class='tc-time'>5.4sec</div>
169169
</th>
170170
</tr>
171171
<tr><th class="column" colspan="4">

conformance/tests/annotations_generators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ def generator7() -> Iterator[dict[str, int]]:
8484

8585

8686
def generator8() -> int: # E: incompatible return type
87-
yield None # E
87+
yield None # E?
8888
return 0
8989

9090

9191
async def generator9() -> int: # E: incompatible return type
92-
yield None # E
92+
yield None # E?
9393

9494

9595
class IntIterator(Protocol):

0 commit comments

Comments
 (0)