MCPcopy Index your code
hub / github.com/python/cpython / test_pickling

Method test_pickling

Lib/test/test_ast/test_ast.py:1121–1129  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1119 yield from do(ast.AST)
1120
1121 def test_pickling(self):
1122 import pickle
1123
1124 for protocol in range(pickle.HIGHEST_PROTOCOL + 1):
1125 for code in exec_tests:
1126 with self.subTest(code=code, protocol=protocol):
1127 tree = compile(code, "?", "exec", 0x400)
1128 ast2 = pickle.loads(pickle.dumps(tree, protocol))
1129 self.assertEqual(to_tuple(ast2), to_tuple(tree))
1130
1131 @skip_if_unlimited_stack_size
1132 def test_copy_with_parents(self):

Callers

nothing calls this directly

Calls 6

to_tupleFunction · 0.90
compileFunction · 0.50
subTestMethod · 0.45
loadsMethod · 0.45
dumpsMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected