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

Method test_pickle

Lib/test/test_slice.py:244–252  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

242 self.assertEqual(tmp, [(slice(1, 2), 42)])
243
244 def test_pickle(self):
245 import pickle
246
247 s = slice(10, 20, 3)
248 for protocol in range(pickle.HIGHEST_PROTOCOL + 1):
249 t = loads(dumps(s, protocol))
250 self.assertEqual(s, t)
251 self.assertEqual(s.indices(15), t.indices(15))
252 self.assertNotEqual(id(s), id(t))
253
254 def test_copy(self):
255 s = slice(1, 10)

Callers

nothing calls this directly

Calls 6

sliceClass · 0.85
idFunction · 0.85
assertNotEqualMethod · 0.80
loadsFunction · 0.50
dumpsFunction · 0.50
assertEqualMethod · 0.45

Tested by

no test coverage detected