Skip to content

Commit 3998da0

Browse files
Conformance tests: Fix pyright scoring for protocols_variance (#1702)
Pyright produces warnings instead of errors for many issues in this test case. Part of #1692
1 parent 1bb065a commit 3998da0

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

conformance/results/pyright/protocols_definition.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,4 @@ protocols_definition.py:341:22 - error: Expression of type "Concrete6_Bad3" cann
9696
conformance_automated = "Pass"
9797
errors_diff = """
9898
"""
99+
ignore_errors = ["Static methods should not take a \"self\" or \"cls\" parameter"]

conformance/results/pyright/protocols_variance.toml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@ protocols_variance.py:71:7 - warning: Type variable "T1_contra" used in generic
1010
protocols_variance.py:72:21 - error: Contravariant type variable cannot be used in return type (reportGeneralTypeIssues)
1111
protocols_variance.py:104:7 - warning: Type variable "T1" used in generic protocol "Protocol12" should be covariant (reportInvalidTypeVarUse)
1212
"""
13-
conformance_automated = "Fail"
13+
conformance_automated = "Pass"
1414
errors_diff = """
15-
Line 21: Expected 1 errors
16-
Line 40: Expected 1 errors
17-
Line 56: Expected 1 errors
18-
Line 61: Expected 1 errors
19-
Line 66: Expected 1 errors
20-
Line 71: Expected 1 errors
21-
Line 104: Expected 1 errors
2215
"""

conformance/results/pyright/qualifiers_final_decorator.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ qualifiers_final_decorator.py:126:5 - error: Function "func1" cannot be marked @
1818
conformance_automated = "Pass"
1919
errors_diff = """
2020
"""
21+
ignore_errors = ["reportMissingModuleSource"]

conformance/src/type_checker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]:
191191
assert line.count(":") >= 3, f"Failed to parse line: {line!r}"
192192
_, lineno, kind, _ = line.split(":", maxsplit=3)
193193
kind = kind.split()[-1]
194-
if kind != "error":
194+
if kind not in ("error", "warning"):
195195
continue
196196
line_to_errors.setdefault(int(lineno), []).append(line)
197197
return line_to_errors

0 commit comments

Comments
 (0)