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
"""

0 commit comments

Comments
 (0)