Skip to content

Commit d4f39b2

Browse files
Edit error marker comments on some tests (#2048)
* edit error markers and regenerate results * Add back newline * Add back newline --------- Co-authored-by: Rebecca Chen <[email protected]>
1 parent e35ffb6 commit d4f39b2

File tree

10 files changed

+28
-17
lines changed

10 files changed

+28
-17
lines changed

conformance/results/mypy/enums_behaviors.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ conformant = "Pass"
22
errors_diff = """
33
"""
44
output = """
5-
enums_behaviors.py:39: error: Cannot extend enum with existing members: "Shape" [misc]
5+
enums_behaviors.py:28: error: Expression is of type "Color", not "Literal[Color.RED]" [assert-type]
6+
enums_behaviors.py:32: error: Expression is of type "Color", not "Literal[Color.BLUE]" [assert-type]
7+
enums_behaviors.py:44: error: Cannot extend enum with existing members: "Shape" [misc]
68
"""
79
conformance_automated = "Pass"

conformance/results/mypy/version.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
version = "mypy 1.17.0"
2-
test_duration = 2.7
2+
test_duration = 1.9

conformance/results/pyre/enums_behaviors.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ conformance_automated = "Pass"
55
errors_diff = """
66
"""
77
output = """
8-
enums_behaviors.py:39:0 Invalid inheritance [39]: Cannot inherit from final enum `Shape`. Enums with defined members cannot be extended.
8+
enums_behaviors.py:28:0 Assert type [70]: Expected `typing_extensions.Literal[Color.RED]` but got `Color`.
9+
enums_behaviors.py:32:0 Assert type [70]: Expected `typing_extensions.Literal[Color.BLUE]` but got `Color`.
10+
enums_behaviors.py:44:0 Invalid inheritance [39]: Cannot inherit from final enum `Shape`. Enums with defined members cannot be extended.
911
"""

conformance/results/pyre/qualifiers_final_decorator.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ qualifiers_final_decorator.py:126:0 Invalid inheritance [39]: `final` cannot be
1818
"""
1919
conformance_automated = "Fail"
2020
errors_diff = """
21-
Lines 80, 89: Expected error (tag 'Derived3')
22-
Lines 94, 102: Expected error (tag 'Derived4')
21+
Lines 80, 81, 89: Expected error (tag 'Derived3')
22+
Lines 94, 95, 102: Expected error (tag 'Derived4')
2323
Line 51: Unexpected errors ['qualifiers_final_decorator.py:51:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).']
2424
"""

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 = 3.9
2+
test_duration = 7.4

conformance/results/pyright/enums_behaviors.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ conformant = "Pass"
22
errors_diff = """
33
"""
44
output = """
5-
enums_behaviors.py:39:21 - error: Enum class "Shape" is final and cannot be subclassed (reportGeneralTypeIssues)
5+
enums_behaviors.py:28:13 - error: "assert_type" mismatch: expected "Literal[Color.RED]" but received "Color" (reportAssertTypeFailure)
6+
enums_behaviors.py:32:13 - error: "assert_type" mismatch: expected "Literal[Color.BLUE]" but received "Color" (reportAssertTypeFailure)
7+
enums_behaviors.py:44:21 - error: Enum class "Shape" is final and cannot be subclassed (reportGeneralTypeIssues)
68
"""
79
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 = 5.6
2+
test_duration = 1.4

conformance/results/results.html

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

conformance/tests/enums_behaviors.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Specification: https://typing.readthedocs.io/en/latest/spec/enums.html#enum-definition
66

77
from enum import Enum
8-
from typing import assert_type
8+
from typing import assert_type, Literal
99

1010
# > Enum classes are iterable and indexable, and they can be called with a
1111
# > value to look up the enum member with that value. Type checkers should
@@ -23,8 +23,13 @@ class Color(Enum):
2323
# > constructor. Instead, the call performs a value-based lookup of an
2424
# > enum member.
2525

26-
assert_type(Color["RED"], Color) # 'Literal[Color.RED]' is also acceptable
27-
assert_type(Color(3), Color) # 'Literal[Color.BLUE]' is also acceptable
26+
# 'Literal[Color.RED]' and 'Color' are both acceptable
27+
assert_type(Color["RED"], Color) # E[red]
28+
assert_type(Color["RED"], Literal[Color.RED]) # E[red]
29+
30+
# 'Literal[Color.BLUE]' and 'Color' are both acceptable
31+
assert_type(Color(3), Color) # E[blue]
32+
assert_type(Color(3), Literal[Color.BLUE]) # E[blue]
2833

2934

3035
# > An Enum class with one or more defined members cannot be subclassed.

conformance/tests/qualifiers_final_decorator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def method3() -> None: # E[method3]
6565
pass
6666

6767
@overload # E[method4]
68-
def method4(self, x: int) -> int:
68+
def method4(self, x: int) -> int: # E[method4]
6969
...
7070

7171
@overload
@@ -78,7 +78,7 @@ def method4(self, x: int | str) -> int | str: # E[method4]
7878

7979
class Derived3(Base3):
8080
@overload # E[Derived3]
81-
def method(self, x: int) -> int:
81+
def method(self, x: int) -> int: # E[Derived3]
8282
...
8383

8484
@overload # E[Derived3-2]
@@ -92,7 +92,7 @@ def method(self, x: int | str) -> int | str: # E[Derived3]
9292

9393
class Derived4(Base4):
9494
@overload # E[Derived4]
95-
def method(self, x: int) -> int:
95+
def method(self, x: int) -> int: # E[Derived4]
9696
...
9797

9898
@overload

0 commit comments

Comments
 (0)