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

Method test_pickling

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

Source from the content-addressed store, hash-verified

1111 yield from do(ast.AST)
1112
1113 def test_pickling(self):
1114 import pickle
1115
1116 for protocol in range(pickle.HIGHEST_PROTOCOL + 1):
1117 for code in exec_tests:
1118 with self.subTest(code=code, protocol=protocol):
1119 tree = compile(code, "?", "exec", 0x400)
1120 ast2 = pickle.loads(pickle.dumps(tree, protocol))
1121 self.assertEqual(to_tuple(ast2), to_tuple(tree))
1122
1123 @skip_if_unlimited_stack_size
1124 def test_copy_with_parents(self):

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected