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_array.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_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) |