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

Method test_vsBuiltinSort

Lib/test/test_bisect.py:303–313  ·  view source on GitHub ↗
(self, n=500)

Source from the content-addressed store, hash-verified

301
302class TestInsort:
303 def test_vsBuiltinSort(self, n=500):
304 from random import choice
305 for insorted in (list(), UserList()):
306 for i in range(n):
307 digit = choice("0123456789")
308 if digit in "02468":
309 f = self.module.insort_left
310 else:
311 f = self.module.insort_right
312 f(insorted, digit)
313 self.assertEqual(sorted(insorted), insorted)
314
315 def test_backcompatibility(self):
316 self.assertEqual(self.module.insort, self.module.insort_right)

Callers

nothing calls this directly

Calls 5

UserListClass · 0.90
listClass · 0.85
choiceFunction · 0.85
fFunction · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected