Skip to content

Commit 45500fd

Browse files
committed
Add additional callable kwargs conformance tests
1 parent b5a44f1 commit 45500fd

19 files changed

+67
-46
lines changed

conformance/results/mypy/callables_kwargs.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
conformant = "Pass"
1+
conformant = "Partial"
22
output = """
33
callables_kwargs.py:22: note: "func1" defined here
44
callables_kwargs.py:46: error: Missing named argument "v1" for "func1" [call-arg]
@@ -21,6 +21,8 @@ callables_kwargs.py:103: note: "TDProtocol5.__call__" has type "Callable[[Arg(in
2121
callables_kwargs.py:111: error: Overlap between argument names and ** TypedDict items: "v1" [misc]
2222
callables_kwargs.py:122: error: Unpack item in ** argument must be a TypedDict [misc]
2323
"""
24-
conformance_automated = "Pass"
24+
conformance_automated = "Fail"
2525
errors_diff = """
26+
Line 130: Expected 1 errors
27+
Line 138: Expected 1 errors
2628
"""
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = "mypy 1.14.0"
2-
test_duration = 1.6
1+
version = "mypy 1.14.1"
2+
test_duration = 1.2

conformance/results/pyre/callables_kwargs.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ callables_kwargs.py:102:0 Incompatible variable type [9]: v4 is declared to have
1515
callables_kwargs.py:103:0 Incompatible variable type [9]: v5 is declared to have type `TDProtocol5` but is used as type `typing.Callable(func1)[[Keywords(Unpack[TD2])], None]`.
1616
callables_kwargs.py:111:21 Duplicate parameter [65]: Duplicate parameter name `v1`.
1717
callables_kwargs.py:122:12 Invalid type [31]: `Unpack` in kwargs may only be used with typed dictionaries. `Variable[T (bound to TD2)]` is not a typed dictionary.
18+
callables_kwargs.py:130:0 Incompatible variable type [9]: v7 is declared to have type `TDProtocol6` but is used as type `typing.Callable(func7)[[KeywordOnly(v1, int), KeywordOnly(v3, str), KeywordOnly(v2, str, default)], None]`.
19+
callables_kwargs.py:138:4 Missing argument [20]: Call `func7` expects argument `v2` to be a required typed dictionary key, as the corresponding parameter has no default.
1820
"""
1921
conformance_automated = "Pass"
2022
errors_diff = """
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 = 7.3
2+
test_duration = 8.1

conformance/results/pyright/aliases_explicit.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@ aliases_explicit.py:79:21 - error: Invalid expression form for type alias defini
1010
aliases_explicit.py:79:21 - error: Call expression not allowed in type expression (reportInvalidTypeForm)
1111
aliases_explicit.py:80:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm)
1212
aliases_explicit.py:80:21 - error: List expression not allowed in type expression
13-
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
13+
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
1414
aliases_explicit.py:80:21 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues)
1515
aliases_explicit.py:81:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm)
1616
aliases_explicit.py:81:21 - error: Tuple expression not allowed in type expression
17-
  Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
17+
  Use tuple[T1, ..., Tn] to indicate a tuple type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
1818
aliases_explicit.py:82:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm)
1919
aliases_explicit.py:82:21 - error: List expression not allowed in type expression
20-
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
20+
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
2121
aliases_explicit.py:82:21 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues)
2222
aliases_explicit.py:83:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm)
2323
aliases_explicit.py:83:21 - error: Dictionary expression not allowed in type expression
24-
  Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm)
24+
  Use dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm)
2525
aliases_explicit.py:83:21 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues)
2626
aliases_explicit.py:83:28 - error: "b" is not defined (reportUndefinedVariable)
2727
aliases_explicit.py:84:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm)
2828
aliases_explicit.py:84:21 - error: Call expression not allowed in type expression (reportInvalidTypeForm)
2929
aliases_explicit.py:85:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm)
3030
aliases_explicit.py:85:21 - error: List expression not allowed in type expression
31-
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
31+
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
3232
aliases_explicit.py:85:21 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues)
3333
aliases_explicit.py:85:27 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues)
3434
aliases_explicit.py:86:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm)

conformance/results/pyright/aliases_type_statement.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ aliases_type_statement.py:31:22 - error: Argument of type "TypeAliasType" cannot
1414
    "TypeAliasType" is not assignable to "tuple[_ClassInfo, ...]" (reportArgumentType)
1515
aliases_type_statement.py:37:22 - error: Call expression not allowed in type expression (reportInvalidTypeForm)
1616
aliases_type_statement.py:38:22 - error: List expression not allowed in type expression
17-
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
17+
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
1818
aliases_type_statement.py:38:22 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues)
1919
aliases_type_statement.py:39:22 - error: Tuple expression not allowed in type expression
20-
  Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
20+
  Use tuple[T1, ..., Tn] to indicate a tuple type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
2121
aliases_type_statement.py:40:22 - error: List expression not allowed in type expression
22-
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
22+
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
2323
aliases_type_statement.py:40:22 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues)
2424
aliases_type_statement.py:41:22 - error: Dictionary expression not allowed in type expression
25-
  Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm)
25+
  Use dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm)
2626
aliases_type_statement.py:41:22 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues)
2727
aliases_type_statement.py:41:29 - error: "b" is not defined (reportUndefinedVariable)
2828
aliases_type_statement.py:42:22 - error: Call expression not allowed in type expression (reportInvalidTypeForm)
2929
aliases_type_statement.py:43:22 - error: List expression not allowed in type expression
30-
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
30+
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
3131
aliases_type_statement.py:43:22 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues)
3232
aliases_type_statement.py:43:28 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues)
3333
aliases_type_statement.py:44:22 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm)

conformance/results/pyright/aliases_typealiastype.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ aliases_typealiastype.py:56:42 - error: Expected class but received "dict[str, U
1919
aliases_typealiastype.py:56:49 - error: "b" is not defined (reportUndefinedVariable)
2020
aliases_typealiastype.py:57:42 - error: Call expression not allowed in type expression (reportInvalidTypeForm)
2121
aliases_typealiastype.py:58:42 - error: List expression not allowed in type expression
22-
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
22+
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
2323
aliases_typealiastype.py:58:42 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues)
2424
aliases_typealiastype.py:58:48 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues)
2525
aliases_typealiastype.py:59:42 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm)

conformance/results/pyright/annotations_forward_refs.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ annotations_forward_refs.py:24:7 - error: Union syntax cannot be used with strin
66
annotations_forward_refs.py:25:13 - error: Union syntax cannot be used with string operand; use quotes around entire expression (reportGeneralTypeIssues)
77
annotations_forward_refs.py:41:10 - error: Call expression not allowed in type expression (reportInvalidTypeForm)
88
annotations_forward_refs.py:42:10 - error: List expression not allowed in type expression
9-
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
9+
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
1010
annotations_forward_refs.py:42:10 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues)
1111
annotations_forward_refs.py:43:10 - error: Tuple expression not allowed in type expression
12-
  Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
12+
  Use tuple[T1, ..., Tn] to indicate a tuple type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
1313
annotations_forward_refs.py:44:10 - error: List expression not allowed in type expression
14-
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
14+
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
1515
annotations_forward_refs.py:44:10 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues)
1616
annotations_forward_refs.py:45:10 - error: Dictionary expression not allowed in type expression
17-
  Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm)
17+
  Use dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm)
1818
annotations_forward_refs.py:45:10 - error: Expected class but received "dict[Unknown, Unknown]" (reportGeneralTypeIssues)
1919
annotations_forward_refs.py:46:10 - error: Call expression not allowed in type expression (reportInvalidTypeForm)
2020
annotations_forward_refs.py:47:10 - error: List expression not allowed in type expression
21-
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
21+
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
2222
annotations_forward_refs.py:47:10 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues)
2323
annotations_forward_refs.py:47:16 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues)
2424
annotations_forward_refs.py:48:10 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm)

conformance/results/pyright/annotations_typeexpr.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ conformant = "Pass"
22
output = """
33
annotations_typeexpr.py:88:9 - error: Call expression not allowed in type expression (reportInvalidTypeForm)
44
annotations_typeexpr.py:89:9 - error: List expression not allowed in type expression
5-
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
5+
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
66
annotations_typeexpr.py:89:9 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues)
77
annotations_typeexpr.py:90:9 - error: Tuple expression not allowed in type expression
8-
  Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
8+
  Use tuple[T1, ..., Tn] to indicate a tuple type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
99
annotations_typeexpr.py:91:9 - error: List expression not allowed in type expression
10-
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
10+
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
1111
annotations_typeexpr.py:91:9 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues)
1212
annotations_typeexpr.py:92:9 - error: Dictionary expression not allowed in type expression
13-
  Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm)
13+
  Use dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm)
1414
annotations_typeexpr.py:92:9 - error: Expected class but received "dict[Unknown, Unknown]" (reportGeneralTypeIssues)
1515
annotations_typeexpr.py:93:9 - error: Call expression not allowed in type expression (reportInvalidTypeForm)
1616
annotations_typeexpr.py:94:9 - error: List expression not allowed in type expression
17-
  Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm)
17+
  Use list[T] to indicate a list type or T1 | T2 to indicate a union type (reportInvalidTypeForm)
1818
annotations_typeexpr.py:94:9 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues)
1919
annotations_typeexpr.py:94:15 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues)
2020
annotations_typeexpr.py:95:9 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm)

conformance/results/pyright/callables_kwargs.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
conformant = "Pass"
1+
conformant = "Partial"
22
output = """
33
callables_kwargs.py:28:5 - error: Could not access item in TypedDict
44
  "v2" is not a required key in "TD2", so access may result in runtime exception (reportTypedDictNotRequiredAccess)
@@ -28,6 +28,8 @@ callables_kwargs.py:103:19 - error: Type "(**kwargs: **TD2) -> None" is not assi
2828
callables_kwargs.py:111:30 - error: Typed dictionary overlaps with keyword parameter: v1 (reportGeneralTypeIssues)
2929
callables_kwargs.py:122:21 - error: Expected TypedDict type argument for Unpack (reportGeneralTypeIssues)
3030
"""
31-
conformance_automated = "Pass"
31+
conformance_automated = "Fail"
3232
errors_diff = """
33+
Line 130: Expected 1 errors
34+
Line 138: Expected 1 errors
3335
"""

0 commit comments

Comments
 (0)