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

Method test_index

Lib/test/test_bigmem.py:1161–1168  ·  view source on GitHub ↗
(self, size)

Source from the content-addressed store, hash-verified

1159
1160 @bigmemtest(size=_2G // 5 + 2, memuse=pointer_size * 5)
1161 def test_index(self, size):
1162 l = [1, 2, 3, 4, 5] * size
1163 size *= 5
1164 self.assertEqual(l.index(1), 0)
1165 self.assertEqual(l.index(5, size - 5), size - 1)
1166 self.assertEqual(l.index(5, size - 5, size), size - 1)
1167 self.assertRaises(ValueError, l.index, 1, size - 4, size)
1168 self.assertRaises(ValueError, l.index, 6)
1169
1170 # This tests suffers from overallocation, just like test_append.
1171 @bigmemtest(size=_2G + 10, memuse=pointer_size * 9/8)

Callers

nothing calls this directly

Calls 3

assertEqualMethod · 0.45
indexMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected