Skip to content

Commit 778f8b7

Browse files
committed
fix fixtures
1 parent e3063bf commit 778f8b7

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

test-data/unit/check-expressions.test

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2496,18 +2496,12 @@ T() # E: "TypeVar" not callable
24962496
[case testStringDisallowedUnpacking]
24972497
d: dict[str, str]
24982498

2499-
for a1, b1 in d: # E: Unpacking a string is disallowed \
2500-
# E: "str" object is not iterable
2501-
reveal_type(a1) # E: Cannot determine type of "a1" \
2502-
# N: Revealed type is "Any"
2503-
reveal_type(b1) # E: Cannot determine type of "b1" \
2504-
# N: Revealed type is "Any"
2499+
for a1, b1 in d: # E: Unpacking a string is disallowed
2500+
reveal_type(a1) # N: Revealed type is "builtins.str"
2501+
reveal_type(b1) # N: Revealed type is "builtins.str"
25052502

25062503
s = "foo"
2507-
a2, b2 = s # E: Unpacking a string is disallowed \
2508-
# E: "str" object is not iterable
2509-
reveal_type(a2) # E: Cannot determine type of "a2" \
2510-
# N: Revealed type is "Any"
2511-
reveal_type(b2) # E: Cannot determine type of "b2" \
2512-
# N: Revealed type is "Any"
2513-
[builtins fixtures/dict.pyi]
2504+
a2, b2 = s # E: Unpacking a string is disallowed
2505+
reveal_type(a2) # N: Revealed type is "builtins.str"
2506+
reveal_type(b2) # N: Revealed type is "builtins.str"
2507+
[builtins fixtures/primitives.pyi]

test-data/unit/check-unions.test

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -725,9 +725,10 @@ bad: Union[int, str]
725725

726726
x, y = bad # E: "int" object is not iterable \
727727
# E: Unpacking a string is disallowed
728-
reveal_type(x) # N: Revealed type is "Any"
729-
reveal_type(y) # N: Revealed type is "Any"
730-
[out]
728+
reveal_type(x) # N: Revealed type is "Union[Any, builtins.str]"
729+
reveal_type(y) # N: Revealed type is "Union[Any, builtins.str]"
730+
[builtins fixtures/primitives.pyi]
731+
731732

732733
[case testUnionAlwaysTooMany]
733734
from typing import Union, Tuple

0 commit comments

Comments
 (0)