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

Method test_copy

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

Source from the content-addressed store, hash-verified

252 self.assertNotEqual(id(s), id(t))
253
254 def test_copy(self):
255 s = slice(1, 10)
256 c = copy.copy(s)
257 self.assertIs(s, c)
258
259 s = slice(1, 10, 2)
260 c = copy.copy(s)
261 self.assertIs(s, c)
262
263 # Corner case for mutable indices:
264 s = slice([1, 2], [3, 4], [5, 6])
265 c = copy.copy(s)
266 self.assertIs(s, c)
267 self.assertIs(s.start, c.start)
268 self.assertIs(s.stop, c.stop)
269 self.assertIs(s.step, c.step)
270
271 def test_deepcopy(self):
272 s = slice(1, 10)

Callers

nothing calls this directly

Calls 3

sliceClass · 0.85
copyMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected