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

Method test_basic

Lib/test/test_builtin.py:2795–2808  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2793class TestSorted(unittest.TestCase):
2794
2795 def test_basic(self):
2796 data = list(range(100))
2797 copy = data[:]
2798 random.shuffle(copy)
2799 self.assertEqual(data, sorted(copy))
2800 self.assertNotEqual(data, copy)
2801
2802 data.reverse()
2803 random.shuffle(copy)
2804 self.assertEqual(data, sorted(copy, key=lambda x: -x))
2805 self.assertNotEqual(data, copy)
2806 random.shuffle(copy)
2807 self.assertEqual(data, sorted(copy, reverse=True))
2808 self.assertNotEqual(data, copy)
2809
2810 def test_bad_arguments(self):
2811 # Issue #29327: The first argument is positional-only.

Callers

nothing calls this directly

Calls 5

listClass · 0.85
shuffleMethod · 0.80
assertNotEqualMethod · 0.80
assertEqualMethod · 0.45
reverseMethod · 0.45

Tested by

no test coverage detected