diff options
Diffstat (limited to 'Lib/test/test_index.py')
-rw-r--r-- | Lib/test/test_index.py | 22 |
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(): |