MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_index

Method test_index

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

Source from the content-addressed store, hash-verified

1181
1182 @bigmemtest(size=_2G // 5 + 2, memuse=pointer_size * 5)
1183 def test_index(self, size):
1184 l = [1, 2, 3, 4, 5] * size
1185 size *= 5
1186 self.assertEqual(l.index(1), 0)
1187 self.assertEqual(l.index(5, size - 5), size - 1)
1188 self.assertEqual(l.index(5, size - 5, size), size - 1)
1189 self.assertRaises(ValueError, l.index, 1, size - 4, size)
1190 self.assertRaises(ValueError, l.index, 6)
1191
1192 # This tests suffers from overallocation, just like test_append.
1193 @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