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

Method test_copy_and_deepcopy

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

Source from the content-addressed store, hash-verified

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,

Callers

nothing calls this directly

Calls 5

copyFunction · 0.90
deepcopyFunction · 0.90
TypeVarClass · 0.85
subTestMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected