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

Method test_basic

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

Source from the content-addressed store, hash-verified

2747class TestSorted(unittest.TestCase):
2748
2749 def test_basic(self):
2750 data = list(range(100))
2751 copy = data[:]
2752 random.shuffle(copy)
2753 self.assertEqual(data, sorted(copy))
2754 self.assertNotEqual(data, copy)
2755
2756 data.reverse()
2757 random.shuffle(copy)
2758 self.assertEqual(data, sorted(copy, key=lambda x: -x))
2759 self.assertNotEqual(data, copy)
2760 random.shuffle(copy)
2761 self.assertEqual(data, sorted(copy, reverse=True))
2762 self.assertNotEqual(data, copy)
2763
2764 def test_bad_arguments(self):
2765 # Issue #29327: The first argument is positional-only.

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected