-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated conformance results for mypy 1.12. (#1866)
* Fixes bugs that previously caused a crash when running generics_defaults and generics_syntax_declarations tests. * Fixes conformance issues in the following tests: aliases_type_statement, generics_paramspec_components, generics_syntax_declarations, generics_variance_inference, tuples_type_compat. * Adds support for functionality covered by tests: typeddicts_readonly, typeddicts_readonly_consistency, typeddicts_readonly_inheritance, typeddicts_readonly_kwargs, typeddicts_readonly_update. Fixed bugs in a couple of tests that were uncovered by mypy update. * The aliases_type_statement test assumed errors would be reported on a particular line. * The generics_syntax_declarations test assumed certain unspecified behaviors when evaluating the type of a type parameter. * The generics_variance_inference test was missing a return type annotation.
- Loading branch information
Showing
33 changed files
with
198 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,42 @@ | ||
conformant = "Unsupported" | ||
output = """ | ||
generics_defaults.py:24: error: "T" cannot appear after "DefaultStrT" in type parameter list because it has no default type [misc] | ||
generics_defaults.py:30: error: Expression is of type "type[NoNonDefaults[Any, Any]]", not "type[NoNonDefaults[str, int]]" [assert-type] | ||
generics_defaults.py:31: error: Expression is of type "type[NoNonDefaults[Any, Any]]", not "type[NoNonDefaults[str, int]]" [assert-type] | ||
generics_defaults.py:38: error: Expression is of type "type[OneDefault[Any, Any]]", not "type[OneDefault[float, bool]]" [assert-type] | ||
generics_defaults.py:45: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[Any, Any, str, int, bool]]" [assert-type] | ||
generics_defaults.py:46: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type] | ||
generics_defaults.py:50: error: Type application has too few types (expected between 2 and 5) [misc] | ||
generics_defaults.py:52: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type] | ||
generics_defaults.py:55: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type] | ||
generics_defaults.py:59: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type] | ||
generics_defaults.py:79: error: Expression is of type "type[Class_ParamSpec[Any]]", not "type[Class_ParamSpec[[str, int]]]" [assert-type] | ||
generics_defaults.py:94: error: Expression is of type "type[Class_TypeVarTuple[*tuple[Any, ...]]]", not "type[Class_TypeVarTuple[str, int]]" [assert-type] | ||
generics_defaults.py:151: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type] | ||
generics_defaults.py:151: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] | ||
generics_defaults.py:152: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type] | ||
generics_defaults.py:152: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] | ||
generics_defaults.py:166: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type] | ||
generics_defaults.py:167: error: Expression is of type "Any", not "int" [assert-type] | ||
generics_defaults.py:167: error: Access to generic instance variables via class is ambiguous [misc] | ||
""" | ||
conformance_automated = "Fail" | ||
errors_diff = """ | ||
Line 24: Expected 1 errors | ||
Line 50: Expected 1 errors | ||
Line 104: Expected 1 errors | ||
Line 111: Expected 1 errors | ||
Line 138: Expected 1 errors | ||
Line 30: Unexpected errors ['generics_defaults.py:30: error: Expression is of type "type[NoNonDefaults[Any, Any]]", not "type[NoNonDefaults[str, int]]" [assert-type]'] | ||
Line 31: Unexpected errors ['generics_defaults.py:31: error: Expression is of type "type[NoNonDefaults[Any, Any]]", not "type[NoNonDefaults[str, int]]" [assert-type]'] | ||
Line 38: Unexpected errors ['generics_defaults.py:38: error: Expression is of type "type[OneDefault[Any, Any]]", not "type[OneDefault[float, bool]]" [assert-type]'] | ||
Line 45: Unexpected errors ['generics_defaults.py:45: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[Any, Any, str, int, bool]]" [assert-type]'] | ||
Line 46: Unexpected errors ['generics_defaults.py:46: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]'] | ||
Line 52: Unexpected errors ['generics_defaults.py:52: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]'] | ||
Line 55: Unexpected errors ['generics_defaults.py:55: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]'] | ||
Line 59: Unexpected errors ['generics_defaults.py:59: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]'] | ||
Line 79: Unexpected errors ['generics_defaults.py:79: error: Expression is of type "type[Class_ParamSpec[Any]]", not "type[Class_ParamSpec[[str, int]]]" [assert-type]'] | ||
Line 94: Unexpected errors ['generics_defaults.py:94: error: Expression is of type "type[Class_TypeVarTuple[*tuple[Any, ...]]]", not "type[Class_TypeVarTuple[str, int]]" [assert-type]'] | ||
Line 151: Unexpected errors ['generics_defaults.py:151: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type]', 'generics_defaults.py:151: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] | ||
Line 152: Unexpected errors ['generics_defaults.py:152: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type]', 'generics_defaults.py:152: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] | ||
Line 166: Unexpected errors ['generics_defaults.py:166: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type]'] | ||
Line 167: Unexpected errors ['generics_defaults.py:167: error: Expression is of type "Any", not "int" [assert-type]', 'generics_defaults.py:167: error: Access to generic instance variables via class is ambiguous [misc]'] | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 13 additions & 15 deletions
28
conformance/results/mypy/generics_syntax_declarations.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
conformant = "Partial" | ||
notes = """ | ||
Does not detect many illegal usages of type parameter syntax. | ||
""" | ||
conformant = "Pass" | ||
output = """ | ||
generics_syntax_declarations.py:17: error: Generic[...] base class is redundant [misc] | ||
generics_syntax_declarations.py:25: error: No arguments expected for "Protocol" base class [misc] | ||
generics_syntax_declarations.py:32: error: "T" has no attribute "is_integer" [attr-defined] | ||
generics_syntax_declarations.py:44: error: Name "V" is not defined [name-defined] | ||
generics_syntax_declarations.py:48: error: Bracketed expression "[...]" is not valid as a type [valid-type] | ||
generics_syntax_declarations.py:60: error: Type variable must have at least two constrained types [misc] | ||
generics_syntax_declarations.py:64: error: Type variable must have at least two constrained types [misc] | ||
generics_syntax_declarations.py:71: error: Variable "generics_syntax_declarations.t1" is not valid as a type [valid-type] | ||
generics_syntax_declarations.py:71: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases | ||
generics_syntax_declarations.py:75: error: Invalid type: try using Literal[3] instead? [valid-type] | ||
generics_syntax_declarations.py:79: error: Name "S" is not defined [name-defined] | ||
""" | ||
conformance_automated = "Fail" | ||
conformance_automated = "Pass" | ||
errors_diff = """ | ||
Line 19: Expected 1 errors | ||
Line 27: Expected 1 errors | ||
Line 34: Expected 1 errors | ||
Line 46: Expected 1 errors | ||
Line 50: Expected 1 errors | ||
Line 62: Expected 1 errors | ||
Line 66: Expected 1 errors | ||
Line 73: Expected 1 errors | ||
Line 77: Expected 1 errors | ||
Line 81: Expected 1 errors | ||
""" |
Oops, something went wrong.