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

Method test_pickling

Lib/test/test_turtle.py:203–210  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

201 self.assertNotEqual(vec2, vec3)
202
203 def test_pickling(self):
204 vec = Vec2D(0.5, 2)
205 for proto in range(pickle.HIGHEST_PROTOCOL + 1):
206 with self.subTest(proto=proto):
207 pickled = pickle.dumps(vec, protocol=proto)
208 unpickled = pickle.loads(pickled)
209 self.assertEqual(unpickled, vec)
210 self.assertIsInstance(unpickled, Vec2D)
211
212 def _assert_arithmetic_cases(self, test_cases, lambda_operator):
213 for test_case in test_cases:

Callers

nothing calls this directly

Calls 6

assertIsInstanceMethod · 0.80
Vec2DClass · 0.70
subTestMethod · 0.45
dumpsMethod · 0.45
loadsMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected