Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents fc20b0c + eda70b8 commit 3f06469Copy full SHA for 3f06469
1 file changed
Lib/test/test_sort.py
@@ -111,6 +111,12 @@ def __repr__(self):
111
s.sort(key=CmpToKey(lambda a, b: int(random.random() * 3) - 1))
112
check("an insane function left some permutation", x, s)
113
114
+ if len(x) >= 2:
115
+ def bad_key(x):
116
+ raise RuntimeError
117
+ s = x[:]
118
+ self.assertRaises(RuntimeError, s.sort, key=bad_key)
119
+
120
x = [Complains(i) for i in x]
121
s = x[:]
122
random.shuffle(s)
0 commit comments