diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-06-30 22:57:08 +0000 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-06-30 22:57:08 +0000 |
commit | 5c8da86f3a515ce1a6d5f27fd15e3c5f4d8e931e (patch) | |
tree | 41f38aca16748628d53906337f06fdf087f52314 /Lib/test/test_int.py | |
parent | be96cf608fa656d7e53144cf85082ed5661e8c13 (diff) | |
download | cpython-git-5c8da86f3a515ce1a6d5f27fd15e3c5f4d8e931e.tar.gz |
convert usage of fail* to assert*
Diffstat (limited to 'Lib/test/test_int.py')
-rw-r--r-- | Lib/test/test_int.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_int.py b/Lib/test/test_int.py index 514a98e74c..e4cac0cc74 100644 --- a/Lib/test/test_int.py +++ b/Lib/test/test_int.py @@ -76,15 +76,15 @@ class IntTestCases(unittest.TestCase): s = repr(-1-sys.maxint) x = int(s) self.assertEqual(x+1, -sys.maxint) - self.assert_(isinstance(x, int)) + self.assertTrue(isinstance(x, int)) # should return long self.assertEqual(int(s[1:]), sys.maxint+1) # should return long x = int(1e100) - self.assert_(isinstance(x, long)) + self.assertTrue(isinstance(x, long)) x = int(-1e100) - self.assert_(isinstance(x, long)) + self.assertTrue(isinstance(x, long)) # SF bug 434186: 0x80000000/2 != 0x80000000>>1. @@ -102,11 +102,11 @@ class IntTestCases(unittest.TestCase): self.assertRaises(ValueError, int, '123\x00 245', 20) x = int('1' * 600) - self.assert_(isinstance(x, long)) + self.assertTrue(isinstance(x, long)) if have_unicode: x = int(unichr(0x661) * 600) - self.assert_(isinstance(x, long)) + self.assertTrue(isinstance(x, long)) self.assertRaises(TypeError, int, 1, 12) @@ -249,7 +249,7 @@ class IntTestCases(unittest.TestCase): self.assertEqual(k, len(bin(x).lstrip('-0b'))) # Behaviour as specified in the docs if x != 0: - self.assert_(2**(k-1) <= abs(x) < 2**k) + self.assertTrue(2**(k-1) <= abs(x) < 2**k) else: self.assertEqual(k, 0) # Alternative definition: x.bit_length() == 1 + floor(log_2(x)) |