diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-06-30 23:06:06 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-06-30 23:06:06 (GMT) |
commit | c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9 (patch) | |
tree | 6350dab0b481e6de307dc4e043c6230f463a9ca7 /Lib/test/test_array.py | |
parent | 98d23f2e065713ccfbc07d9a0b65f737a212bfb5 (diff) | |
download | cpython-c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9.zip cpython-c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9.tar.gz cpython-c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9.tar.bz2 |
convert old fail* assertions to assert*
Diffstat (limited to 'Lib/test/test_array.py')
-rwxr-xr-x | Lib/test/test_array.py | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py index 8e22839..7ae34a9 100755 --- a/Lib/test/test_array.py +++ b/Lib/test/test_array.py @@ -49,7 +49,7 @@ class BaseTest(unittest.TestCase): def test_constructor(self): a = array.array(self.typecode) self.assertEqual(a.typecode, self.typecode) - self.assert_(a.itemsize>=self.minitemsize) + self.assertTrue(a.itemsize>=self.minitemsize) self.assertRaises(TypeError, array.array, self.typecode, None) def test_len(self): @@ -64,10 +64,10 @@ class BaseTest(unittest.TestCase): a = array.array(self.typecode, self.example) self.assertRaises(TypeError, a.buffer_info, 42) bi = a.buffer_info() - self.assert_(isinstance(bi, tuple)) + self.assertTrue(isinstance(bi, tuple)) self.assertEqual(len(bi), 2) - self.assert_(isinstance(bi[0], int)) - self.assert_(isinstance(bi[1], int)) + self.assertTrue(isinstance(bi[0], int)) + self.assertTrue(isinstance(bi[1], int)) self.assertEqual(bi[1], len(a)) def test_byteswap(self): @@ -216,39 +216,39 @@ class BaseTest(unittest.TestCase): def test_cmp(self): a = array.array(self.typecode, self.example) - self.assert_((a == 42) is False) - self.assert_((a != 42) is True) + self.assertTrue((a == 42) is False) + self.assertTrue((a != 42) is True) - self.assert_((a == a) is True) - self.assert_((a != a) is False) - self.assert_((a < a) is False) - self.assert_((a <= a) is True) - self.assert_((a > a) is False) - self.assert_((a >= a) is True) + self.assertTrue((a == a) is True) + self.assertTrue((a != a) is False) + self.assertTrue((a < a) is False) + self.assertTrue((a <= a) is True) + self.assertTrue((a > a) is False) + self.assertTrue((a >= a) is True) al = array.array(self.typecode, self.smallerexample) ab = array.array(self.typecode, self.biggerexample) - self.assert_((a == 2*a) is False) - self.assert_((a != 2*a) is True) - self.assert_((a < 2*a) is True) - self.assert_((a <= 2*a) is True) - self.assert_((a > 2*a) is False) - self.assert_((a >= 2*a) is False) - - self.assert_((a == al) is False) - self.assert_((a != al) is True) - self.assert_((a < al) is False) - self.assert_((a <= al) is False) - self.assert_((a > al) is True) - self.assert_((a >= al) is True) - - self.assert_((a == ab) is False) - self.assert_((a != ab) is True) - self.assert_((a < ab) is True) - self.assert_((a <= ab) is True) - self.assert_((a > ab) is False) - self.assert_((a >= ab) is False) + self.assertTrue((a == 2*a) is False) + self.assertTrue((a != 2*a) is True) + self.assertTrue((a < 2*a) is True) + self.assertTrue((a <= 2*a) is True) + self.assertTrue((a > 2*a) is False) + self.assertTrue((a >= 2*a) is False) + + self.assertTrue((a == al) is False) + self.assertTrue((a != al) is True) + self.assertTrue((a < al) is False) + self.assertTrue((a <= al) is False) + self.assertTrue((a > al) is True) + self.assertTrue((a >= al) is True) + + self.assertTrue((a == ab) is False) + self.assertTrue((a != ab) is True) + self.assertTrue((a < ab) is True) + self.assertTrue((a <= ab) is True) + self.assertTrue((a > ab) is False) + self.assertTrue((a >= ab) is False) def test_add(self): a = array.array(self.typecode, self.example) \ @@ -267,7 +267,7 @@ class BaseTest(unittest.TestCase): a = array.array(self.typecode, self.example[::-1]) b = a a += array.array(self.typecode, 2*self.example) - self.assert_(a is b) + self.assertTrue(a is b) self.assertEqual( a, array.array(self.typecode, self.example[::-1]+2*self.example) @@ -310,22 +310,22 @@ class BaseTest(unittest.TestCase): b = a a *= 5 - self.assert_(a is b) + self.assertTrue(a is b) self.assertEqual( a, array.array(self.typecode, 5*self.example) ) a *= 0 - self.assert_(a is b) + self.assertTrue(a is b) self.assertEqual(a, array.array(self.typecode)) a *= 1000 - self.assert_(a is b) + self.assertTrue(a is b) self.assertEqual(a, array.array(self.typecode)) a *= -1 - self.assert_(a is b) + self.assertTrue(a is b) self.assertEqual(a, array.array(self.typecode)) a = array.array(self.typecode, self.example) |