MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_builtin_tuple

Method test_builtin_tuple

Lib/test/test_typing.py:1227–1245  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1225 f"typing.Unpack[{__name__}.Movie]")
1226
1227 def test_builtin_tuple(self):
1228 Ts = TypeVarTuple("Ts")
1229
1230 class Old(Generic[*Ts]): ...
1231 class New[*Ts]: ...
1232
1233 PartOld = Old[int, *Ts]
1234 self.assertEqual(PartOld[str].__args__, (int, str))
1235 self.assertEqual(PartOld[*tuple[str]].__args__, (int, str))
1236 self.assertEqual(PartOld[*Tuple[str]].__args__, (int, str))
1237 self.assertEqual(PartOld[Unpack[tuple[str]]].__args__, (int, str))
1238 self.assertEqual(PartOld[Unpack[Tuple[str]]].__args__, (int, str))
1239
1240 PartNew = New[int, *Ts]
1241 self.assertEqual(PartNew[str].__args__, (int, str))
1242 self.assertEqual(PartNew[*tuple[str]].__args__, (int, str))
1243 self.assertEqual(PartNew[*Tuple[str]].__args__, (int, str))
1244 self.assertEqual(PartNew[Unpack[tuple[str]]].__args__, (int, str))
1245 self.assertEqual(PartNew[Unpack[Tuple[str]]].__args__, (int, str))
1246
1247 def test_unpack_wrong_type(self):
1248 Ts = TypeVarTuple("Ts")

Callers

nothing calls this directly

Calls 2

TypeVarTupleClass · 0.85
assertEqualMethod · 0.45

Tested by

no test coverage detected