diff options
author | Georg Brandl <georg@python.org> | 2009-08-13 08:51:18 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-08-13 08:51:18 (GMT) |
commit | ab91fdef1f1e556203a2eee98ba7d379e4790de9 (patch) | |
tree | 6f8f00dc18cc5f2801a675df277c2c595eb85ec8 /Lib/test/test_index.py | |
parent | ef82be368abdea8e8032500e7ecc3a22f5f07851 (diff) | |
download | cpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.zip cpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.tar.gz cpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.tar.bz2 |
Merged revisions 73715 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k
........
r73715 | benjamin.peterson | 2009-07-01 01:06:06 +0200 (Mi, 01 Jul 2009) | 1 line
convert old fail* assertions to assert*
........
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(): |