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

Method test_pickle

Lib/test/test_genericalias.py:433–443  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

431 MyType[int]
432
433 def test_pickle(self):
434 aliases = [GenericAlias(list, T)] + _UNPACKED_TUPLES
435 for alias in aliases:
436 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
437 with self.subTest(alias=alias, proto=proto):
438 s = pickle.dumps(alias, proto)
439 loaded = pickle.loads(s)
440 self.assertEqual(loaded.__origin__, alias.__origin__)
441 self.assertEqual(loaded.__args__, alias.__args__)
442 self.assertEqual(loaded.__parameters__, alias.__parameters__)
443 self.assertEqual(type(loaded), type(alias))
444
445 def test_copy(self):
446 class X(list):

Callers

nothing calls this directly

Calls 5

GenericAliasFunction · 0.90
subTestMethod · 0.80
dumpsMethod · 0.45
loadsMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected