|
2 | 2 |
|
3 | 3 | from __future__ import annotations
|
4 | 4 |
|
5 |
| -from typing import Tuple |
6 |
| - |
7 | 5 | from mypy.argmap import map_actuals_to_formals
|
8 | 6 | from mypy.checker import DisjointDict, group_comparison_operands
|
9 | 7 | from mypy.literals import Key
|
@@ -46,15 +44,18 @@ def test_too_many_caller_args(self) -> None:
|
46 | 44 |
|
47 | 45 | def test_tuple_star(self) -> None:
|
48 | 46 | any_type = AnyType(TypeOfAny.special_form)
|
49 |
| - self.assert_vararg_map([ARG_STAR], [ARG_POS], [[0]], self.tuple(any_type)) |
| 47 | + self.assert_vararg_map([ARG_STAR], [ARG_POS], [[0]], self.make_tuple(any_type)) |
50 | 48 | self.assert_vararg_map(
|
51 |
| - [ARG_STAR], [ARG_POS, ARG_POS], [[0], [0]], self.tuple(any_type, any_type) |
| 49 | + [ARG_STAR], [ARG_POS, ARG_POS], [[0], [0]], self.make_tuple(any_type, any_type) |
52 | 50 | )
|
53 | 51 | self.assert_vararg_map(
|
54 |
| - [ARG_STAR], [ARG_POS, ARG_OPT, ARG_OPT], [[0], [0], []], self.tuple(any_type, any_type) |
| 52 | + [ARG_STAR], |
| 53 | + [ARG_POS, ARG_OPT, ARG_OPT], |
| 54 | + [[0], [0], []], |
| 55 | + self.make_tuple(any_type, any_type), |
55 | 56 | )
|
56 | 57 |
|
57 |
| - def tuple(self, *args: Type) -> TupleType: |
| 58 | + def make_tuple(self, *args: Type) -> TupleType: |
58 | 59 | return TupleType(list(args), TypeFixture().std_tuple)
|
59 | 60 |
|
60 | 61 | def test_named_args(self) -> None:
|
@@ -92,7 +93,7 @@ def test_special_cases(self) -> None:
|
92 | 93 | def assert_map(
|
93 | 94 | self,
|
94 | 95 | caller_kinds_: list[ArgKind | str],
|
95 |
| - callee_kinds_: list[ArgKind | Tuple[ArgKind, str]], |
| 96 | + callee_kinds_: list[ArgKind | tuple[ArgKind, str]], |
96 | 97 | expected: list[list[int]],
|
97 | 98 | ) -> None:
|
98 | 99 | caller_kinds, caller_names = expand_caller_kinds(caller_kinds_)
|
|
0 commit comments