(self)
| 5333 | del PP |
| 5334 | |
| 5335 | def test_copy_and_deepcopy(self): |
| 5336 | T = TypeVar('T') |
| 5337 | class Node(Generic[T]): ... |
| 5338 | things = [Union[T, int], Tuple[T, int], Tuple[()], |
| 5339 | Callable[..., T], Callable[[int], int], |
| 5340 | Tuple[Any, Any], Node[T], Node[int], Node[Any], typing.Iterable[T], |
| 5341 | typing.Iterable[Any], typing.Iterable[int], typing.Dict[int, str], |
| 5342 | typing.Dict[T, Any], ClassVar[int], ClassVar[List[T]], Tuple['T', 'T'], |
| 5343 | Union['T', int], List['T'], typing.Mapping['T', int], |
| 5344 | Union[b"x", b"y"], Any] |
| 5345 | for t in things: |
| 5346 | with self.subTest(thing=t): |
| 5347 | self.assertEqual(t, copy(t)) |
| 5348 | self.assertEqual(t, deepcopy(t)) |
| 5349 | |
| 5350 | def test_immutability_by_copy_and_pickle(self): |
| 5351 | # Special forms like Union, Any, etc., generic aliases to containers like List, |
nothing calls this directly
no test coverage detected