Skip to content

Commit d37d815

Browse files
committed
Change the error code to a random error code and allow the error to happen
1 parent ca781d2 commit d37d815

5 files changed

Lines changed: 7 additions & 8 deletions

File tree

conformance/results/mypy/directives_type_ignore.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Does not honor "# type: ignore" comment if comment includes additional text.
55
output = """
66
directives_type_ignore.py:11: error: Invalid "type: ignore" comment [syntax]
77
directives_type_ignore.py:11: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]
8+
directives_type_ignore.py:16: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]
9+
directives_type_ignore.py:16: note: Error code "assignment" not covered by "type: ignore" comment
810
"""
911
conformance_automated = "Fail"
1012
errors_diff = """

conformance/results/results.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ <h3>Python Type System Conformance Test Results</h3>
11931193
<th class="column col2 conformant">Pass</th>
11941194
<th class="column col2 conformant">Pass</th>
11951195
<th class="column col2 conformant">Pass</th>
1196-
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Treats `# type: ignore[error-code]` as only ignoring errors that match the error code `error-code`.</p></span></div></th>
1196+
<th class="column col2 conformant">Pass</th>
11971197
</tr>
11981198
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;directives_type_ignore_file1</th>
11991199
<th class="column col2 conformant">Pass</th>

conformance/results/ty/directives_type_ignore.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
conformance_automated = "Fail"
2-
conformant = "Partial"
3-
notes = """
4-
Treats `# type: ignore[error-code]` as only ignoring errors that match the error code `error-code`.
5-
"""
1+
conformance_automated = "Pass"
62
errors_diff = """
7-
Line 16: Unexpected errors ['directives_type_ignore.py:16:10: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int`']
83
"""
94
output = """
105
directives_type_ignore.py:16:10: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int`

conformance/results/zuban/directives_type_ignore.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ conformance_automated = "Pass"
22
errors_diff = """
33
"""
44
output = """
5+
directives_type_ignore.py:16: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]
6+
directives_type_ignore.py:16: note: Error code "assignment" not covered by "type: ignore" comment
57
"""

conformance/tests/directives_type_ignore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# The following type violation may be suppressed, depending whether the
1414
# type checker uses the error code `assignment` for invalid assignments,
1515
# and/or how it treats unknown error codes.
16-
z: int = "" # type: ignore[assignment]
16+
z: int = "" # type: ignore[an-empty-str-is-not-an-int] # E?
1717

1818
# > In some cases, linting tools or other comments may be needed on the same
1919
# > line as a type comment. In these cases, the type comment should be before

0 commit comments

Comments
 (0)