[pypy-svn] pypy default: Fix the test to except either ValueError or TypeError with these

arigo commits-noreply at bitbucket.org
Tue Jan 25 17:47:53 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r41305:6b0343265f85
Date: 2011-01-24 15:47 +0100
http://bitbucket.org/pypy/pypy/changeset/6b0343265f85/

Log:	Fix the test to except either ValueError or TypeError with these
	mistyped arguments.

diff --git a/lib-python/modified-2.7.0/test/test_itertools.py b/lib-python/modified-2.7.0/test/test_itertools.py
--- a/lib-python/modified-2.7.0/test/test_itertools.py
+++ b/lib-python/modified-2.7.0/test/test_itertools.py
@@ -785,11 +785,11 @@
         self.assertRaises(ValueError, islice, xrange(10), 1, -5, -1)
         self.assertRaises(ValueError, islice, xrange(10), 1, 10, -1)
         self.assertRaises(ValueError, islice, xrange(10), 1, 10, 0)
-        self.assertRaises(ValueError, islice, xrange(10), 'a')
-        self.assertRaises(ValueError, islice, xrange(10), 'a', 1)
-        self.assertRaises(ValueError, islice, xrange(10), 1, 'a')
-        self.assertRaises(ValueError, islice, xrange(10), 'a', 1, 1)
-        self.assertRaises(ValueError, islice, xrange(10), 1, 'a', 1)
+        self.assertRaises((ValueError,TypeError), islice, xrange(10), 'a')
+        self.assertRaises((ValueError,TypeError), islice, xrange(10), 'a', 1)
+        self.assertRaises((ValueError,TypeError), islice, xrange(10), 1, 'a')
+        self.assertRaises((ValueError,TypeError), islice, xrange(10), 'a', 1, 1)
+        self.assertRaises((ValueError,TypeError), islice, xrange(10), 1, 'a', 1)
         self.assertEqual(len(list(islice(count(), 1, 10, maxsize))), 1)
 
     def test_takewhile(self):


More information about the Pypy-commit mailing list