Skip to content

Commit 3b7c926

Browse files
committed
add new test cases
1 parent 2021073 commit 3b7c926

7 files changed

Lines changed: 130 additions & 113 deletions

File tree

‎conformance/results/mypy/callables_kwargs.toml‎

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,34 +35,36 @@ callables_kwargs.py:166: error: Unexpected keyword argument "closed" for "__init
3535
callables_kwargs.py:170: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]
3636
callables_kwargs.py:174: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
3737
callables_kwargs.py:178: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
38+
callables_kwargs.py:182: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]
3839
"""
3940
conformance_automated = "Fail"
4041
errors_diff = """
4142
Line 154: Expected 1 errors
42-
Line 210: Expected 1 errors
43-
Line 212: Expected 1 errors
44-
Line 213: Expected 1 errors
45-
Line 215: Expected 1 errors
46-
Line 216: Expected 1 errors
47-
Line 217: Expected 1 errors
48-
Line 221: Expected 1 errors
4943
Line 223: Expected 1 errors
50-
Line 224: Expected 1 errors
44+
Line 225: Expected 1 errors
5145
Line 226: Expected 1 errors
52-
Line 227: Expected 1 errors
5346
Line 228: Expected 1 errors
47+
Line 229: Expected 1 errors
48+
Line 230: Expected 1 errors
49+
Line 238: Expected 1 errors
50+
Line 240: Expected 1 errors
51+
Line 241: Expected 1 errors
5452
Line 243: Expected 1 errors
5553
Line 244: Expected 1 errors
56-
Line 246: Expected 1 errors
57-
Line 247: Expected 1 errors
58-
Line 249: Expected 1 errors
59-
Line 250: Expected 1 errors
60-
Line 251: Expected 1 errors
61-
Line 252: Expected 1 errors
54+
Line 245: Expected 1 errors
55+
Line 264: Expected 1 errors
56+
Line 265: Expected 1 errors
57+
Line 267: Expected 1 errors
58+
Line 268: Expected 1 errors
59+
Line 270: Expected 1 errors
60+
Line 271: Expected 1 errors
61+
Line 272: Expected 1 errors
62+
Line 273: Expected 1 errors
6263
Line 23: Unexpected errors ['callables_kwargs.py:23: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]']
6364
Line 27: Unexpected errors ['callables_kwargs.py:27: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
6465
Line 166: Unexpected errors ['callables_kwargs.py:166: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]']
6566
Line 170: Unexpected errors ['callables_kwargs.py:170: error: Unexpected keyword argument "closed" for "__init_subclass__" of "TypedDict" [call-arg]']
6667
Line 174: Unexpected errors ['callables_kwargs.py:174: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
6768
Line 178: Unexpected errors ['callables_kwargs.py:178: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
69+
Line 182: Unexpected errors ['callables_kwargs.py:182: error: Unexpected keyword argument "extra_items" for "__init_subclass__" of "TypedDict" [call-arg]']
6870
"""

‎conformance/results/pycroscope/callables_kwargs.toml‎

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,14 @@ Does not reject unpacking an open TypedDict in a call to a callable whose `**kwa
55
"""
66
conformance_automated = "Fail"
77
errors_diff = """
8-
Line 210: Expected 1 errors
9-
Line 212: Expected 1 errors
10-
Line 213: Expected 1 errors
11-
Line 215: Expected 1 errors
12-
Line 216: Expected 1 errors
13-
Line 217: Expected 1 errors
14-
Line 221: Expected 1 errors
158
Line 223: Expected 1 errors
16-
Line 224: Expected 1 errors
179
Line 226: Expected 1 errors
18-
Line 227: Expected 1 errors
19-
Line 228: Expected 1 errors
20-
Line 243: Expected 1 errors
10+
Line 229: Expected 1 errors
11+
Line 230: Expected 1 errors
12+
Line 238: Expected 1 errors
13+
Line 241: Expected 1 errors
2114
Line 244: Expected 1 errors
22-
Line 246: Expected 1 errors
23-
Line 247: Expected 1 errors
24-
Line 249: Expected 1 errors
25-
Line 250: Expected 1 errors
26-
Line 251: Expected 1 errors
27-
Line 252: Expected 1 errors
28-
Line 155: Unexpected errors ["./callables_kwargs.py:155:0: Incompatible assignment: expected callables_kwargs.TDProtocol7, got function 'callables_kwargs.func7' [incompatible_assignment]"]
29-
Line 156: Unexpected errors ["./callables_kwargs.py:156:0: Incompatible assignment: expected callables_kwargs.TDProtocol8, got function 'callables_kwargs.func7' [incompatible_assignment]"]
15+
Line 245: Expected 1 errors
3016
"""
3117
output = """
3218
./callables_kwargs.py:55:4: In call to callables_kwargs.func1: Missing required argument 'v1' [incompatible_call]
@@ -43,6 +29,16 @@ output = """
4329
./callables_kwargs.py:131:21: Parameter v1 overlaps with TypedDict key in **kwargs [invalid_annotation]
4430
./callables_kwargs.py:142:12: Expected TypedDict type inside Unpack[] for **kwargs [invalid_annotation]
4531
./callables_kwargs.py:154:0: Incompatible assignment: expected callables_kwargs.TDProtocol6, got function 'callables_kwargs.func7' [incompatible_assignment]
46-
./callables_kwargs.py:155:0: Incompatible assignment: expected callables_kwargs.TDProtocol7, got function 'callables_kwargs.func7' [incompatible_assignment]
47-
./callables_kwargs.py:156:0: Incompatible assignment: expected callables_kwargs.TDProtocol8, got function 'callables_kwargs.func7' [incompatible_assignment]
32+
./callables_kwargs.py:225:4: Incompatible argument type for kwargs: expected dict[str, str] but got <dict containing {**{str?: object}}> [incompatible_argument]
33+
./callables_kwargs.py:228:4: Incompatible argument type for kwargs: expected dict[str, str] but got <dict containing {**{str?: object}}> [incompatible_argument]
34+
./callables_kwargs.py:240:4: Incompatible argument type for kwargs: expected dict[str, str] but got <dict containing {**{str?: object}}> [incompatible_argument]
35+
./callables_kwargs.py:243:4: Incompatible argument type for kwargs: expected dict[str, str] but got <dict containing {**{str?: object}}> [incompatible_argument]
36+
./callables_kwargs.py:264:4: In call to callables_kwargs.takes_name: **kwargs provided but not used [incompatible_call]
37+
./callables_kwargs.py:265:4: Incompatible argument type for kwargs: expected dict[str, str] but got <dict containing {**{str: int}}> [incompatible_argument]
38+
./callables_kwargs.py:267:4: In call to callables_kwargs.takes_name: **kwargs provided but not used [incompatible_call]
39+
./callables_kwargs.py:268:4: Incompatible argument type for kwargs: expected dict[str, str] but got <dict containing {**{str: int}}> [incompatible_argument]
40+
./callables_kwargs.py:270:4: In call to callables_kwargs.takes_closed: **kwargs provided but not used [incompatible_call]
41+
./callables_kwargs.py:271:4: In call to callables_kwargs.takes_closed: **kwargs provided but not used [incompatible_call]
42+
./callables_kwargs.py:272:4: Incompatible argument type for label: expected str but got int [incompatible_argument]
43+
./callables_kwargs.py:273:4: Incompatible argument type for label: expected str but got int [incompatible_argument]
4844
"""

‎conformance/results/pyrefly/callables_kwargs.toml‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,26 @@ Incorrectly rejects assigning a callable without `**kwargs` to a callable whose
1010
"""
1111
conformance_automated = "Fail"
1212
errors_diff = """
13-
Line 210: Expected 1 errors
14-
Line 212: Expected 1 errors
15-
Line 213: Expected 1 errors
16-
Line 215: Expected 1 errors
17-
Line 216: Expected 1 errors
18-
Line 217: Expected 1 errors
19-
Line 221: Expected 1 errors
2013
Line 223: Expected 1 errors
21-
Line 224: Expected 1 errors
14+
Line 225: Expected 1 errors
2215
Line 226: Expected 1 errors
23-
Line 227: Expected 1 errors
2416
Line 228: Expected 1 errors
17+
Line 229: Expected 1 errors
18+
Line 230: Expected 1 errors
19+
Line 238: Expected 1 errors
20+
Line 240: Expected 1 errors
21+
Line 241: Expected 1 errors
2522
Line 243: Expected 1 errors
2623
Line 244: Expected 1 errors
27-
Line 246: Expected 1 errors
28-
Line 247: Expected 1 errors
29-
Line 249: Expected 1 errors
30-
Line 250: Expected 1 errors
31-
Line 251: Expected 1 errors
32-
Line 252: Expected 1 errors
24+
Line 245: Expected 1 errors
25+
Line 264: Expected 1 errors
26+
Line 265: Expected 1 errors
27+
Line 267: Expected 1 errors
28+
Line 268: Expected 1 errors
29+
Line 270: Expected 1 errors
30+
Line 271: Expected 1 errors
31+
Line 272: Expected 1 errors
32+
Line 273: Expected 1 errors
3333
Line 156: Unexpected errors ["`(*, v1: int, v3: str, v2: str = '') -> None` is not assignable to `TDProtocol8` [bad-assignment]"]
3434
"""
3535
output = """

‎conformance/results/pyright/callables_kwargs.toml‎

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,33 +37,33 @@ callables_kwargs.py:142:21 - error: Expected TypedDict type argument for Unpack
3737
callables_kwargs.py:154:19 - error: Type "(*, v1: int, v3: str, v2: str = "") -> None" is not assignable to declared type "TDProtocol6"
3838
  Type "(*, v1: int, v3: str, v2: str = "") -> None" is not assignable to type "(**kwargs: **TD2) -> None"
3939
    Parameter "**kwargs" has no corresponding parameter (reportAssignmentType)
40-
callables_kwargs.py:212:29 - error: Argument of type "object" cannot be assigned to parameter "kwargs" of type "str" in function "takes_name_str_kwargs"
40+
callables_kwargs.py:225:29 - error: Argument of type "object" cannot be assigned to parameter "kwargs" of type "str" in function "takes_name_str_kwargs"
4141
  "object" is not assignable to "str" (reportArgumentType)
42-
callables_kwargs.py:215:29 - error: Argument of type "object" cannot be assigned to parameter "kwargs" of type "str" in function "takes_name_str_kwargs"
42+
callables_kwargs.py:228:29 - error: Argument of type "object" cannot be assigned to parameter "kwargs" of type "str" in function "takes_name_str_kwargs"
4343
  "object" is not assignable to "str" (reportArgumentType)
44-
callables_kwargs.py:223:29 - error: Argument of type "object" cannot be assigned to parameter "kwargs" of type "str" in function "takes_name_str_kwargs"
44+
callables_kwargs.py:240:29 - error: Argument of type "object" cannot be assigned to parameter "kwargs" of type "str" in function "takes_name_str_kwargs"
4545
  "object" is not assignable to "str" (reportArgumentType)
46-
callables_kwargs.py:226:29 - error: Argument of type "object" cannot be assigned to parameter "kwargs" of type "str" in function "takes_name_str_kwargs"
46+
callables_kwargs.py:243:29 - error: Argument of type "object" cannot be assigned to parameter "kwargs" of type "str" in function "takes_name_str_kwargs"
4747
  "object" is not assignable to "str" (reportArgumentType)
48-
callables_kwargs.py:244:29 - error: Argument of type "int" cannot be assigned to parameter "kwargs" of type "str" in function "takes_name_str_kwargs"
48+
callables_kwargs.py:265:29 - error: Argument of type "int" cannot be assigned to parameter "kwargs" of type "str" in function "takes_name_str_kwargs"
4949
  "int" is not assignable to "str" (reportArgumentType)
50-
callables_kwargs.py:247:29 - error: Argument of type "int" cannot be assigned to parameter "kwargs" of type "str" in function "takes_name_str_kwargs"
50+
callables_kwargs.py:268:29 - error: Argument of type "int" cannot be assigned to parameter "kwargs" of type "str" in function "takes_name_str_kwargs"
5151
  "int" is not assignable to "str" (reportArgumentType)
5252
"""
5353
conformance_automated = "Fail"
5454
errors_diff = """
55-
Line 210: Expected 1 errors
56-
Line 213: Expected 1 errors
57-
Line 216: Expected 1 errors
58-
Line 217: Expected 1 errors
59-
Line 221: Expected 1 errors
60-
Line 224: Expected 1 errors
61-
Line 227: Expected 1 errors
62-
Line 228: Expected 1 errors
63-
Line 243: Expected 1 errors
64-
Line 246: Expected 1 errors
65-
Line 249: Expected 1 errors
66-
Line 250: Expected 1 errors
67-
Line 251: Expected 1 errors
68-
Line 252: Expected 1 errors
55+
Line 223: Expected 1 errors
56+
Line 226: Expected 1 errors
57+
Line 229: Expected 1 errors
58+
Line 230: Expected 1 errors
59+
Line 238: Expected 1 errors
60+
Line 241: Expected 1 errors
61+
Line 244: Expected 1 errors
62+
Line 245: Expected 1 errors
63+
Line 264: Expected 1 errors
64+
Line 267: Expected 1 errors
65+
Line 270: Expected 1 errors
66+
Line 271: Expected 1 errors
67+
Line 272: Expected 1 errors
68+
Line 273: Expected 1 errors
6969
"""

‎conformance/results/ty/callables_kwargs.toml‎

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ Does not reject unpacking an open TypedDict in a call to a callable that has no
55
Does not reject unpacking an open TypedDict in a call to a callable whose `**kwargs` is typed with a closed TypedDict.
66
"""
77
errors_diff = """
8-
Line 210: Expected 1 errors
9-
Line 213: Expected 1 errors
10-
Line 216: Expected 1 errors
11-
Line 217: Expected 1 errors
12-
Line 221: Expected 1 errors
13-
Line 224: Expected 1 errors
14-
Line 227: Expected 1 errors
15-
Line 228: Expected 1 errors
8+
Line 223: Expected 1 errors
9+
Line 226: Expected 1 errors
10+
Line 229: Expected 1 errors
11+
Line 230: Expected 1 errors
12+
Line 238: Expected 1 errors
13+
Line 241: Expected 1 errors
14+
Line 244: Expected 1 errors
15+
Line 245: Expected 1 errors
1616
"""
1717
output = """
1818
callables_kwargs.py:55:5: error[missing-argument] No arguments provided for required parameters `v1`, `v3` of function `func1`
@@ -30,16 +30,16 @@ callables_kwargs.py:123:19: error[invalid-assignment] Object of type `def func1(
3030
callables_kwargs.py:131:20: error[invalid-type-form] Parameter `v1` overlaps with unpacked TypedDict key in `**kwargs` annotation
3131
callables_kwargs.py:142:21: error[invalid-type-form] Unpacked value for `**kwargs` must be a TypedDict, not `T@func6`
3232
callables_kwargs.py:154:19: error[invalid-assignment] Object of type `def func7(*, v1: int, v3: str, v2: str = "") -> None` is not assignable to `TDProtocol6`
33-
callables_kwargs.py:212:27: error[invalid-argument-type] Argument to function `takes_name_str_kwargs` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
34-
callables_kwargs.py:215:27: error[invalid-argument-type] Argument to function `takes_name_str_kwargs` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
35-
callables_kwargs.py:223:27: error[invalid-argument-type] Argument to function `takes_name_str_kwargs` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
36-
callables_kwargs.py:226:27: error[invalid-argument-type] Argument to function `takes_name_str_kwargs` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
37-
callables_kwargs.py:243:16: error[unknown-argument] Unpacked argument may contain keyword arguments that do not match any known parameter of function `takes_name`
38-
callables_kwargs.py:244:27: error[invalid-argument-type] Argument to function `takes_name_str_kwargs` is incorrect: Expected `str`, found `int`
39-
callables_kwargs.py:246:16: error[unknown-argument] Unpacked argument may contain keyword arguments that do not match any known parameter of function `takes_name`
40-
callables_kwargs.py:247:27: error[invalid-argument-type] Argument to function `takes_name_str_kwargs` is incorrect: Expected `str`, found `int`
41-
callables_kwargs.py:249:18: error[unknown-argument] Unpacked argument may contain keyword arguments that do not match any known parameter of function `takes_closed`
42-
callables_kwargs.py:250:18: error[unknown-argument] Unpacked argument may contain keyword arguments that do not match any known parameter of function `takes_closed`
43-
callables_kwargs.py:251:37: error[invalid-argument-type] Argument to function `takes_optional_label_int_kwargs` is incorrect: Expected `str`, found `int`
44-
callables_kwargs.py:252:37: error[invalid-argument-type] Argument to function `takes_optional_label_int_kwargs` is incorrect: Expected `str`, found `int`
33+
callables_kwargs.py:225:27: error[invalid-argument-type] Argument to function `takes_name_str_kwargs` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
34+
callables_kwargs.py:228:27: error[invalid-argument-type] Argument to function `takes_name_str_kwargs` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
35+
callables_kwargs.py:240:27: error[invalid-argument-type] Argument to function `takes_name_str_kwargs` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
36+
callables_kwargs.py:243:27: error[invalid-argument-type] Argument to function `takes_name_str_kwargs` is incorrect: Possible extra items in unpacked open `TypedDict` have type `object`, expected `str`
37+
callables_kwargs.py:264:16: error[unknown-argument] Unpacked argument may contain keyword arguments that do not match any known parameter of function `takes_name`
38+
callables_kwargs.py:265:27: error[invalid-argument-type] Argument to function `takes_name_str_kwargs` is incorrect: Expected `str`, found `int`
39+
callables_kwargs.py:267:16: error[unknown-argument] Unpacked argument may contain keyword arguments that do not match any known parameter of function `takes_name`
40+
callables_kwargs.py:268:27: error[invalid-argument-type] Argument to function `takes_name_str_kwargs` is incorrect: Expected `str`, found `int`
41+
callables_kwargs.py:270:18: error[unknown-argument] Unpacked argument may contain keyword arguments that do not match any known parameter of function `takes_closed`
42+
callables_kwargs.py:271:18: error[unknown-argument] Unpacked argument may contain keyword arguments that do not match any known parameter of function `takes_closed`
43+
callables_kwargs.py:272:37: error[invalid-argument-type] Argument to function `takes_optional_label_int_kwargs` is incorrect: Expected `str`, found `int`
44+
callables_kwargs.py:273:37: error[invalid-argument-type] Argument to function `takes_optional_label_int_kwargs` is incorrect: Expected `str`, found `int`
4545
"""

0 commit comments

Comments
 (0)