summaryrefslogtreecommitdiffstats
path: root/Lib/test/list_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/list_tests.py')
-rw-r--r--Lib/test/list_tests.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/list_tests.py b/Lib/test/list_tests.py
index 40316de..44bc2ae 100644
--- a/Lib/test/list_tests.py
+++ b/Lib/test/list_tests.py
@@ -7,6 +7,7 @@ import os
from functools import cmp_to_key
from test import support, seq_tests
+from test.support import ALWAYS_EQ, NEVER_EQ
class CommonTest(seq_tests.CommonTest):
@@ -329,6 +330,20 @@ class CommonTest(seq_tests.CommonTest):
self.assertRaises(TypeError, a.remove)
+ a = self.type2test([1, 2])
+ self.assertRaises(ValueError, a.remove, NEVER_EQ)
+ self.assertEqual(a, [1, 2])
+ a.remove(ALWAYS_EQ)
+ self.assertEqual(a, [2])
+ a = self.type2test([ALWAYS_EQ])
+ a.remove(1)
+ self.assertEqual(a, [])
+ a = self.type2test([ALWAYS_EQ])
+ a.remove(NEVER_EQ)
+ self.assertEqual(a, [])
+ a = self.type2test([NEVER_EQ])
+ self.assertRaises(ValueError, a.remove, ALWAYS_EQ)
+
class BadExc(Exception):
pass