diff -r 63b45c959a2a Lib/test/test_array.py
--- a/Lib/test/test_array.py Sun Nov 04 07:00:04 2012 +0200
+++ b/Lib/test/test_array.py Sat Nov 10 20:38:41 2012 -0800
@@ -94,6 +94,14 @@
self.assertRaises(ValueError, array_reconstructor,
array.array, "d", 16, b"a")
+
+ def test_issue13349(self):
+ a = array.array('i',[1,2,3,4,5])
+ item = 6
+ with self.assertRaises(ValueError) as ve:
+ a.remove(item)
+ self.assertIn(repr(item), str(ve.exception))
+
def test_numbers(self):
testcases = (
(['B', 'H', 'I', 'L'], UNSIGNED_INT8, '=BBBB',
diff -r 63b45c959a2a Lib/test/test_deque.py
--- a/Lib/test/test_deque.py Sun Nov 04 07:00:04 2012 +0200
+++ b/Lib/test/test_deque.py Sat Nov 10 20:38:41 2012 -0800
@@ -332,6 +332,13 @@
d.clear() # clear an emtpy deque
self.assertEqual(list(d), [])
+ def test_issue13349(self):
+ dq = deque('abc')
+ item = 't'
+ with self.assertRaises(ValueError) as ve:
+ dq.remove(item)
+ self.assertIn(item, str(ve.exception))
+
def test_remove(self):
d = deque('abcdefghcij')
d.remove('c')
diff -r 63b45c959a2a Lib/test/test_list.py
--- a/Lib/test/test_list.py Sun Nov 04 07:00:04 2012 +0200
+++ b/Lib/test/test_list.py Sat Nov 10 20:38:41 2012 -0800
@@ -106,6 +106,13 @@
with self.assertRaises(TypeError):
(3,) + L([1,2])
+ def test_issue13349(self):
+ lst = list(range(10))
+ item = 15
+ with self.assertRaises(ValueError) as ve:
+ lst.remove(item)
+ self.assertIn(str(item), str(ve.exception))
+
def test_main(verbose=None):
support.run_unittest(ListTest)
diff -r 63b45c959a2a Lib/test/test_tuple.py
--- a/Lib/test/test_tuple.py Sun Nov 04 07:00:04 2012 +0200
+++ b/Lib/test/test_tuple.py Sat Nov 10 20:38:41 2012 -0800
@@ -18,6 +18,19 @@
self.assertEqual(tuple(''), ())
self.assertEqual(tuple('spam'), ('s', 'p', 'a', 'm'))
+ def test_issue13349(self):
+ tpl = ('a', 'b', 'c')
+ msg_fmt_len = len('tuple.index(..): element not in tuple')
+ item = " ".join([str(i) for i in range(1000)])
+ with self.assertRaises(ValueError) as ve:
+ tpl.index(item)
+ self.assertIn(item[:99], str(ve.exception))
+ self.assertGreaterEqual(100 + msg_fmt_len, len(str(ve.exception)))
+ item = "foo"
+ with self.assertRaises(ValueError) as ve:
+ tpl.index(item)
+ self.assertIn(item, str(ve.exception))
+
def test_truth(self):
super().test_truth()
self.assertTrue(not ())
diff -r 63b45c959a2a Lib/test/test_xml_etree.py
--- a/Lib/test/test_xml_etree.py Sun Nov 04 07:00:04 2012 +0200
+++ b/Lib/test/test_xml_etree.py Sat Nov 10 20:38:41 2012 -0800
@@ -261,9 +261,6 @@
>>> element.remove(subelement)
>>> serialize(element) # 5
'