Skip to content

Commit 7af21d5

Browse files
committed
Move test case where it belongs
1 parent e8d6327 commit 7af21d5

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

test-data/unit/check-inference-context.test

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,18 +1495,3 @@ def g(b: Optional[str]) -> None:
14951495
z: Callable[[], str] = lambda: reveal_type(b) # N: Revealed type is "builtins.str"
14961496
f2(lambda: reveal_type(b)) # N: Revealed type is "builtins.str"
14971497
lambda: reveal_type(b) # N: Revealed type is "builtins.str"
1498-
1499-
[case testInferenceContextMappingGet]
1500-
from typing import Generic, TypeVar, Union
1501-
1502-
_T = TypeVar("_T")
1503-
_K = TypeVar("_K")
1504-
_V = TypeVar("_V")
1505-
1506-
class Mapping(Generic[_K, _V]):
1507-
def get(self, key: _K, default: Union[_V, _T]) -> Union[_V, _T]: ...
1508-
1509-
def check(mapping: Mapping[str, _T]) -> None:
1510-
fail1 = mapping.get("", "")
1511-
fail2: Union[_T, str] = mapping.get("", "")
1512-
[builtins fixtures/tuple.pyi]

test-data/unit/check-inference.test

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3963,3 +3963,18 @@ def f() -> None:
39633963

39643964
# The type below should not be Any.
39653965
reveal_type(x) # N: Revealed type is "builtins.int"
3966+
3967+
[case testInferenceMappingTypeVarGet]
3968+
from typing import Generic, TypeVar, Union
3969+
3970+
_T = TypeVar("_T")
3971+
_K = TypeVar("_K")
3972+
_V = TypeVar("_V")
3973+
3974+
class Mapping(Generic[_K, _V]):
3975+
def get(self, key: _K, default: Union[_V, _T]) -> Union[_V, _T]: ...
3976+
3977+
def check(mapping: Mapping[str, _T]) -> None:
3978+
ok1 = mapping.get("", "")
3979+
ok2: Union[_T, str] = mapping.get("", "")
3980+
[builtins fixtures/tuple.pyi]

0 commit comments

Comments
 (0)