(self)
| 5440 | del PP |
| 5441 | |
| 5442 | def test_copy_and_deepcopy(self): |
| 5443 | T = TypeVar('T') |
| 5444 | class Node(Generic[T]): ... |
| 5445 | things = [Union[T, int], Tuple[T, int], Tuple[()], |
| 5446 | Callable[..., T], Callable[[int], int], |
| 5447 | Tuple[Any, Any], Node[T], Node[int], Node[Any], typing.Iterable[T], |
| 5448 | typing.Iterable[Any], typing.Iterable[int], typing.Dict[int, str], |
| 5449 | typing.Dict[T, Any], ClassVar[int], ClassVar[List[T]], Tuple['T', 'T'], |
| 5450 | Union['T', int], List['T'], typing.Mapping['T', int], |
| 5451 | Union[b"x", b"y"], Any] |
| 5452 | for t in things: |
| 5453 | with self.subTest(thing=t): |
| 5454 | self.assertEqual(t, copy(t)) |
| 5455 | self.assertEqual(t, deepcopy(t)) |
| 5456 | |
| 5457 | def test_immutability_by_copy_and_pickle(self): |
| 5458 | # Special forms like Union, Any, etc., generic aliases to containers like List, |
nothing calls this directly
no test coverage detected