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

Method test_python_lists

Lib/test/test_descr.py:462–474  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

460 self.assertEqual(a[i][j], i*j)
461
462 def test_python_lists(self):
463 # Testing Python subclass of list...
464 class C(list):
465 def __getitem__(self, i):
466 if isinstance(i, slice):
467 return i.start, i.stop
468 return list.__getitem__(self, i) + 100
469 a = C()
470 a.extend([0,1,2])
471 self.assertEqual(a[0], 100)
472 self.assertEqual(a[1], 101)
473 self.assertEqual(a[2], 102)
474 self.assertEqual(a[100:200], (100,200))
475
476 def test_metaclass(self):
477 # Testing metaclasses...

Callers

nothing calls this directly

Calls 3

CClass · 0.70
extendMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected