Skip to content

Commit e523717

Browse files
authored
Updated conformance test results for the latest versions of type chec… (#1904)
Updated conformance test results for the latest versions of type checkers. Mypy 1.14: * Added support for @deprecated * Added support for default TypeVar values * Fixed conformance issues with enums * Fixed conformance issues with generics (constrained TypeVars and ParamSpecs) * Fixed conformance issues with TypedDict ReadOnly Pyright 1.1.391: * No changes
1 parent a434c99 commit e523717

21 files changed

+64
-88
lines changed
Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1-
conformant = "Unsupported"
2-
notes = """
3-
Does not support @deprecated.
4-
"""
5-
conformance_automated = "Fail"
1+
conformant = "Pass"
2+
conformance_automated = "Pass"
63
errors_diff = """
7-
Line 18: Expected 1 errors
8-
Line 24: Expected 1 errors
9-
Line 25: Expected 1 errors
10-
Line 30: Expected 1 errors
11-
Line 41: Expected 1 errors
12-
Line 42: Expected 1 errors
13-
Line 44: Expected 1 errors
14-
Line 47: Expected 1 errors
15-
Line 48: Expected 1 errors
16-
Line 58: Expected 1 errors
17-
Line 69: Expected 1 errors
18-
Line 98: Expected 1 errors
194
"""
205
output = """
6+
directives_deprecated.py:18: error: class _directives_deprecated_library.Ham is deprecated: Use Spam instead [deprecated]
7+
directives_deprecated.py:24: error: function _directives_deprecated_library.norwegian_blue is deprecated: It is pining for the fjords [deprecated]
8+
directives_deprecated.py:25: error: function _directives_deprecated_library.norwegian_blue is deprecated: It is pining for the fjords [deprecated]
9+
directives_deprecated.py:30: error: overload def (x: builtins.int) -> builtins.str of function _directives_deprecated_library.foo is deprecated: Only str will be allowed [deprecated]
10+
directives_deprecated.py:41: error: function _directives_deprecated_library.Spam.__add__ is deprecated: There is enough spam in the world [deprecated]
11+
directives_deprecated.py:42: error: function _directives_deprecated_library.Spam.__add__ is deprecated: There is enough spam in the world [deprecated]
12+
directives_deprecated.py:44: error: function _directives_deprecated_library.Spam.greasy is deprecated: All spam will be equally greasy [deprecated]
13+
directives_deprecated.py:47: error: function _directives_deprecated_library.Spam.shape is deprecated: Shapes are becoming immutable [deprecated]
14+
directives_deprecated.py:48: error: function _directives_deprecated_library.Spam.shape is deprecated: Shapes are becoming immutable [deprecated]
15+
directives_deprecated.py:58: error: function directives_deprecated.Invocable.__call__ is deprecated: Deprecated [deprecated]
16+
directives_deprecated.py:69: error: function directives_deprecated.lorem is deprecated: Deprecated [deprecated]
17+
directives_deprecated.py:98: error: function directives_deprecated.SupportsFoo1.foo is deprecated: Deprecated [deprecated]
2118
"""

conformance/results/mypy/enums_members.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
conformant = "Partial"
22
notes = """
33
Does not treat attribute with annotation and no assignment as non-member.
4-
Does not reject use of annotation with enum member.
54
Does not treat callables as non-members.
65
Does not honor `enum.member` as method decorator.
76
Does not properly handle aliased enum members.
@@ -10,7 +9,6 @@ Does not treat attributes with private names as non-members.
109
"""
1110
conformance_automated = "Fail"
1211
errors_diff = """
13-
Line 50: Expected 1 errors
1412
Line 82: Expected 1 errors
1513
Line 83: Expected 1 errors
1614
Line 129: Expected 1 errors
@@ -26,6 +24,8 @@ enums_members.py:27: error: Expression is of type "Literal[Pet.genus]", not "str
2624
enums_members.py:28: error: Expression is of type "Literal[Pet.species]", not "str" [assert-type]
2725
enums_members.py:35: error: Expression is of type "Literal[Pet2.genus]", not "str" [assert-type]
2826
enums_members.py:36: error: Expression is of type "Literal[Pet2.species]", not "str" [assert-type]
27+
enums_members.py:50: error: Enum members must be left unannotated [misc]
28+
enums_members.py:50: note: See https://typing.readthedocs.io/en/latest/spec/enums.html#defining-members
2929
enums_members.py:84: error: Expression is of type "Callable[[Pet4], str]", not "Any" [assert-type]
3030
enums_members.py:84: error: Parameter 1 of Literal[...] is invalid [valid-type]
3131
enums_members.py:85: error: Expression is of type "Callable[[Pet4], None]", not "Any" [assert-type]
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
conformant = "Partial"
2-
notes = """
3-
Does not reject the use of a constraint parameterized by another type variable.
4-
"""
1+
conformant = "Pass"
52
output = """
63
generics_basic.py:40: error: Value of type variable "AnyStr" of "concat" cannot be "Sequence[object]" [type-var]
74
generics_basic.py:41: error: Value of type variable "AnyStr" of "concat" cannot be "Sequence[object]" [type-var]
85
generics_basic.py:49: error: Type variable must have at least two constrained types [misc]
6+
generics_basic.py:55: error: TypeVar constraint type cannot be parametrized by type variables [misc]
97
generics_basic.py:69: error: Value of type variable "AnyStr" of "concat" cannot be "Sequence[object]" [type-var]
108
generics_basic.py:121: error: Duplicate type variables in Generic[...] or Protocol[...] [misc]
119
generics_basic.py:157: error: Invalid index type "int" for "MyMap1[str, int]"; expected type "str" [index]
@@ -19,7 +17,6 @@ generics_basic.py:208: error: Type variable "generics_basic.T" is unbound [vali
1917
generics_basic.py:208: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class)
2018
generics_basic.py:208: note: (Hint: Use "T" in function signature to bind "T" inside a function)
2119
"""
22-
conformance_automated = "Fail"
20+
conformance_automated = "Pass"
2321
errors_diff = """
24-
Line 55: Expected 1 errors
2522
"""

conformance/results/mypy/generics_defaults.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
conformant = "Unsupported"
1+
conformant = "Partial"
22
output = """
33
generics_defaults.py:24: error: "T" cannot appear after "DefaultStrT" in type parameter list because it has no default type [misc]
44
generics_defaults.py:30: error: Expression is of type "type[NoNonDefaults[Any, Any]]", not "type[NoNonDefaults[str, int]]" [assert-type]

conformance/results/mypy/generics_defaults_referential.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
conformant = "Unsupported"
1+
conformant = "Partial"
22
output = """
33
generics_defaults_referential.py:23: error: Expression is of type "type[slice[Any, Any, Any]]", not "type[slice[int, int, int | None]]" [assert-type]
44
generics_defaults_referential.py:37: error: Argument 1 to "Foo" has incompatible type "str"; expected "int" [arg-type]

conformance/results/mypy/generics_defaults_specialization.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
conformant = "Unsupported"
1+
conformant = "Partial"
22
output = """
33
generics_defaults_specialization.py:30: error: Bad number of arguments for type alias, expected between 0 and 1, given 2 [type-arg]
44
generics_defaults_specialization.py:45: error: Expression is of type "type[Bar[Any]]", not "type[Bar[str]]" [assert-type]
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
conformant = "Partial"
2-
notes = """
3-
Does not reject ParamSpec when used "bare" in type alias definition.
4-
"""
1+
conformant = "Pass"
52
output = """
63
generics_paramspec_basic.py:10: error: String argument 1 "NotIt" to ParamSpec(...) does not match variable name "WrongName" [misc]
4+
generics_paramspec_basic.py:15: error: Invalid location for ParamSpec "P" [valid-type]
5+
generics_paramspec_basic.py:15: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]"
76
generics_paramspec_basic.py:23: error: Invalid location for ParamSpec "P" [valid-type]
87
generics_paramspec_basic.py:23: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]"
98
generics_paramspec_basic.py:27: error: Invalid location for Concatenate [valid-type]
@@ -15,7 +14,6 @@ generics_paramspec_basic.py:35: note: You can use ParamSpec as the first argumen
1514
generics_paramspec_basic.py:39: error: Invalid location for ParamSpec "P" [valid-type]
1615
generics_paramspec_basic.py:39: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]"
1716
"""
18-
conformance_automated = "Fail"
17+
conformance_automated = "Pass"
1918
errors_diff = """
20-
Line 15: Expected 1 errors
2119
"""

conformance/results/mypy/narrowing_typeguard.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ narrowing_typeguard.py:102: error: TypeGuard functions must have a positional ar
44
narrowing_typeguard.py:107: error: TypeGuard functions must have a positional argument [valid-type]
55
narrowing_typeguard.py:128: error: Argument 1 to "takes_callable_str" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "Callable[[object], str]" [arg-type]
66
narrowing_typeguard.py:148: error: Argument 1 to "takes_callable_str_proto" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "CallableStrProto" [arg-type]
7+
narrowing_typeguard.py:148: note: "CallableStrProto.__call__" has type "Callable[[Arg(object, 'val')], str]"
78
"""
89
conformance_automated = "Pass"
910
errors_diff = """

conformance/results/mypy/narrowing_typeis.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ narrowing_typeis.py:105: error: "TypeIs" functions must have a positional argume
44
narrowing_typeis.py:110: error: "TypeIs" functions must have a positional argument [valid-type]
55
narrowing_typeis.py:132: error: Argument 1 to "takes_callable_str" has incompatible type "Callable[[object], TypeIs[int]]"; expected "Callable[[object], str]" [arg-type]
66
narrowing_typeis.py:152: error: Argument 1 to "takes_callable_str_proto" has incompatible type "Callable[[object], TypeIs[int]]"; expected "CallableStrProto" [arg-type]
7+
narrowing_typeis.py:152: note: "CallableStrProto.__call__" has type "Callable[[Arg(object, 'val')], str]"
78
narrowing_typeis.py:169: error: Argument 1 to "takes_typeguard" has incompatible type "Callable[[object], TypeIs[int]]"; expected "Callable[[object], TypeGuard[int]]" [arg-type]
89
narrowing_typeis.py:170: error: Argument 1 to "takes_typeis" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "Callable[[object], TypeIs[int]]" [arg-type]
910
narrowing_typeis.py:191: error: Argument 1 to "takes_int_typeis" has incompatible type "Callable[[object], TypeIs[bool]]"; expected "Callable[[object], TypeIs[int]]" [arg-type]

conformance/results/mypy/overloads_basic.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ output = """
33
overloads_basic.py:37: error: No overload variant of "__getitem__" of "Bytes" matches argument type "str" [call-overload]
44
overloads_basic.py:37: note: Possible overload variants:
55
overloads_basic.py:37: note: def __getitem__(self, int, /) -> int
6-
overloads_basic.py:37: note: def __getitem__(self, slice, /) -> bytes
6+
overloads_basic.py:37: note: def __getitem__(self, slice[Any, Any, Any], /) -> bytes
77
overloads_basic.py:62: error: Single overload definition, multiple required [misc]
88
overloads_basic.py:74: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]
99
"""

conformance/results/mypy/qualifiers_annotated.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ qualifiers_annotated.py:91: error: "<typing special form>" not callable [operat
2828
qualifiers_annotated.py:92: error: "<typing special form>" not callable [operator]
2929
qualifiers_annotated.py:98: error: Invalid type: ClassVar nested inside other type [valid-type]
3030
qualifiers_annotated.py:100: error: Final can be only used as an outermost qualifier in a variable annotation [valid-type]
31-
qualifiers_annotated.py:110: error: Required[] can be only used in a TypedDict definition [valid-type]
32-
qualifiers_annotated.py:112: error: NotRequired[] can be only used in a TypedDict definition [valid-type]
3331
qualifiers_annotated.py:119: error: Cannot redefine "T" as a type variable [misc]
3432
qualifiers_annotated.py:119: error: Invalid assignment target [misc]
3533
"""
@@ -40,7 +38,5 @@ Line 85: Expected 1 errors
4038
Line 93: Expected 1 errors
4139
Line 98: Unexpected errors ['qualifiers_annotated.py:98: error: Invalid type: ClassVar nested inside other type [valid-type]']
4240
Line 100: Unexpected errors ['qualifiers_annotated.py:100: error: Final can be only used as an outermost qualifier in a variable annotation [valid-type]']
43-
Line 110: Unexpected errors ['qualifiers_annotated.py:110: error: Required[] can be only used in a TypedDict definition [valid-type]']
44-
Line 112: Unexpected errors ['qualifiers_annotated.py:112: error: NotRequired[] can be only used in a TypedDict definition [valid-type]']
4541
Line 119: Unexpected errors ['qualifiers_annotated.py:119: error: Cannot redefine "T" as a type variable [misc]', 'qualifiers_annotated.py:119: error: Invalid assignment target [misc]']
4642
"""
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
conformant = "Partial"
2-
notes = """
3-
Incorrectly rejects NotRequired directive when used in an Annotated annotation.
4-
"""
1+
conformant = "Pass"
52
output = """
63
typeddicts_readonly.py:24: error: ReadOnly TypedDict key "members" TypedDict is mutated [typeddict-readonly-mutated]
74
typeddicts_readonly.py:36: error: ReadOnly TypedDict key "members" TypedDict is mutated [typeddict-readonly-mutated]
85
typeddicts_readonly.py:50: error: ReadOnly TypedDict key "title" TypedDict is mutated [typeddict-readonly-mutated]
96
typeddicts_readonly.py:51: error: ReadOnly TypedDict key "year" TypedDict is mutated [typeddict-readonly-mutated]
10-
typeddicts_readonly.py:56: error: NotRequired[] can be only used in a TypedDict definition [valid-type]
117
typeddicts_readonly.py:60: error: ReadOnly TypedDict key "title" TypedDict is mutated [typeddict-readonly-mutated]
8+
typeddicts_readonly.py:61: error: ReadOnly TypedDict key "year" TypedDict is mutated [typeddict-readonly-mutated]
129
"""
13-
conformance_automated = "Fail"
10+
conformance_automated = "Pass"
1411
errors_diff = """
15-
Line 61: Expected 1 errors
16-
Line 56: Unexpected errors ['typeddicts_readonly.py:56: error: NotRequired[] can be only used in a TypedDict definition [valid-type]']
1712
"""
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
1-
conformant = "Partial"
2-
notes = """
3-
Incorrectly rejects assignment of required item to not-required read-only item.
4-
"""
1+
conformant = "Pass"
52
output = """
63
typeddicts_readonly_consistency.py:37: error: Incompatible types in assignment (expression has type "A1", variable has type "B1") [assignment]
74
typeddicts_readonly_consistency.py:38: error: Incompatible types in assignment (expression has type "C1", variable has type "B1") [assignment]
85
typeddicts_readonly_consistency.py:40: error: Incompatible types in assignment (expression has type "A1", variable has type "C1") [assignment]
9-
typeddicts_readonly_consistency.py:79: error: Incompatible types in assignment (expression has type "C2", variable has type "A2") [assignment]
106
typeddicts_readonly_consistency.py:81: error: Incompatible types in assignment (expression has type "A2", variable has type "B2") [assignment]
117
typeddicts_readonly_consistency.py:82: error: Incompatible types in assignment (expression has type "C2", variable has type "B2") [assignment]
128
typeddicts_readonly_consistency.py:84: error: Incompatible types in assignment (expression has type "A2", variable has type "C2") [assignment]
139
typeddicts_readonly_consistency.py:85: error: Incompatible types in assignment (expression has type "B2", variable has type "C2") [assignment]
1410
"""
15-
conformance_automated = "Fail"
11+
conformance_automated = "Pass"
1612
errors_diff = """
17-
Line 79: Unexpected errors ['typeddicts_readonly_consistency.py:79: error: Incompatible types in assignment (expression has type "C2", variable has type "A2") [assignment]']
1813
"""
Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1-
conformant = "Partial"
2-
notes = """
3-
Does not support nesting of `Annotated` and `Required` or `NotRequired`.
4-
"""
1+
conformant = "Pass"
52
output = """
63
typeddicts_required.py:12: error: Required[] can be only used in a TypedDict definition [valid-type]
74
typeddicts_required.py:19: error: NotRequired[] can be only used in a TypedDict definition [valid-type]
85
typeddicts_required.py:62: error: "Required[]" type cannot be nested [valid-type]
96
typeddicts_required.py:63: error: "NotRequired[]" type cannot be nested [valid-type]
10-
typeddicts_required.py:68: error: Required[] can be only used in a TypedDict definition [valid-type]
11-
typeddicts_required.py:70: error: Required[] can be only used in a TypedDict definition [valid-type]
127
"""
13-
conformance_automated = "Fail"
8+
conformance_automated = "Pass"
149
errors_diff = """
15-
Line 68: Unexpected errors ['typeddicts_required.py:68: error: Required[] can be only used in a TypedDict definition [valid-type]']
16-
Line 70: Unexpected errors ['typeddicts_required.py:70: error: Required[] can be only used in a TypedDict definition [valid-type]']
1710
"""

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.13.0"
2-
test_duration = 2.5
1+
version = "mypy 1.14.0"
2+
test_duration = 1.6

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.23"
2-
test_duration = 4.3
2+
test_duration = 7.3
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = "pyright 1.1.389"
2-
test_duration = 2.5
1+
version = "pyright 1.1.391"
2+
test_duration = 1.2

conformance/results/pytype/specialtypes_never.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ specialtypes_never.py:11:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in <mod
88
T_co = TypeVar("T_co", covariant=True)
99
\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m
1010
11-
specialtypes_never.py:21:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: bad return type [bad-return-type]
11+
specialtypes_never.py:21:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: bad return type [bad-return-type]
1212
13+
sys.exit(1) \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m
1314
sys.exit(1)
14-
\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m
15+
\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m
1516
1617
specialtypes_never.py:68:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]
1718
@@ -39,7 +40,7 @@ errors_diff = """
3940
Line 19: Expected 1 errors
4041
Line 105: Expected 1 errors
4142
Line 11: Unexpected errors ['specialtypes_never.py:11:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in <module>: argument "covariant" to TypeVar not supported yet [not-supported-yet]']
42-
Line 21: Unexpected errors ['specialtypes_never.py:21:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]']
43+
Line 21: Unexpected errors ['specialtypes_never.py:21:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]']
4344
Line 68: Unexpected errors ['specialtypes_never.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]']
4445
Line 69: Unexpected errors ['specialtypes_never.py:69:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]']
4546
Line 70: Unexpected errors ['specialtypes_never.py:70:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch]']
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
version = "pytype 2024.10.11"
2-
test_duration = 45.2
2+
test_duration = 37.2

0 commit comments

Comments
 (0)