summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_index.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-06-30 23:06:06 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-06-30 23:06:06 (GMT)
commitc9c0f201fed21efcf669dbbf5f923eaf0eeb1db9 (patch)
tree6350dab0b481e6de307dc4e043c6230f463a9ca7 /Lib/test/test_index.py
parent98d23f2e065713ccfbc07d9a0b65f737a212bfb5 (diff)
downloadcpython-c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9.zip
cpython-c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9.tar.gz
cpython-c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9.tar.bz2
convert old fail* assertions to assert*
Diffstat (limited to 'Lib/test/test_index.py')
-rw-r--r--Lib/test/test_index.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/Lib/test/test_index.py b/Lib/test/test_index.py
index 31609c3..ae905c2 100644
--- a/Lib/test/test_index.py
+++ b/Lib/test/test_index.py
@@ -59,10 +59,10 @@ class BaseTestCase(unittest.TestCase):
def test_error(self):
self.o.ind = 'dumb'
self.n.ind = 'bad'
- self.failUnlessRaises(TypeError, operator.index, self.o)
- self.failUnlessRaises(TypeError, operator.index, self.n)
- self.failUnlessRaises(TypeError, slice(self.o).indices, 0)
- self.failUnlessRaises(TypeError, slice(self.n).indices, 0)
+ self.assertRaises(TypeError, operator.index, self.o)
+ self.assertRaises(TypeError, operator.index, self.n)
+ self.assertRaises(TypeError, slice(self.o).indices, 0)
+ self.assertRaises(TypeError, slice(self.n).indices, 0)
class SeqTestCase(unittest.TestCase):
@@ -114,11 +114,11 @@ class SeqTestCase(unittest.TestCase):
self.o.ind = 'dumb'
self.n.ind = 'bad'
indexobj = lambda x, obj: obj.seq[x]
- self.failUnlessRaises(TypeError, indexobj, self.o, self)
- self.failUnlessRaises(TypeError, indexobj, self.n, self)
+ self.assertRaises(TypeError, indexobj, self.o, self)
+ self.assertRaises(TypeError, indexobj, self.n, self)
sliceobj = lambda x, obj: obj.seq[x:]
- self.failUnlessRaises(TypeError, sliceobj, self.o, self)
- self.failUnlessRaises(TypeError, sliceobj, self.n, self)
+ self.assertRaises(TypeError, sliceobj, self.o, self)
+ self.assertRaises(TypeError, sliceobj, self.n, self)
class ListTestCase(SeqTestCase):
@@ -151,7 +151,7 @@ class ListTestCase(SeqTestCase):
lst = [5, 6, 7, 8, 9, 11]
l2 = lst.__imul__(self.n)
- self.assert_(l2 is lst)
+ self.assertTrue(l2 is lst)
self.assertEqual(lst, [5, 6, 7, 8, 9, 11] * 3)
@@ -188,8 +188,8 @@ class OverflowTestCase(unittest.TestCase):
(0, maxsize, 1))
def test_sequence_repeat(self):
- self.failUnlessRaises(OverflowError, lambda: "a" * self.pos)
- self.failUnlessRaises(OverflowError, lambda: "a" * self.neg)
+ self.assertRaises(OverflowError, lambda: "a" * self.pos)
+ self.assertRaises(OverflowError, lambda: "a" * self.neg)
def test_main():