diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2010-01-24 19:26:24 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2010-01-24 19:26:24 (GMT) |
commit | e96159335f6bb26615b57f880bf90440ed0123e4 (patch) | |
tree | 273325221fdef15629ebc63287c4772a3af40879 /Lib/test/test_int.py | |
parent | f41d29a8ebc27aafc18b6850648f1faa918e0e5d (diff) | |
download | cpython-e96159335f6bb26615b57f880bf90440ed0123e4.zip cpython-e96159335f6bb26615b57f880bf90440ed0123e4.tar.gz cpython-e96159335f6bb26615b57f880bf90440ed0123e4.tar.bz2 |
Merged revisions 77727 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r77727 | ezio.melotti | 2010-01-24 18:58:36 +0200 (Sun, 24 Jan 2010) | 1 line
use assert[Not]IsInstance where appropriate
........
Diffstat (limited to 'Lib/test/test_int.py')
-rw-r--r-- | Lib/test/test_int.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Lib/test/test_int.py b/Lib/test/test_int.py index ab463a0..0ea5772 100644 --- a/Lib/test/test_int.py +++ b/Lib/test/test_int.py @@ -53,15 +53,15 @@ class IntTestCases(unittest.TestCase): s = repr(-1-sys.maxsize) x = int(s) self.assertEqual(x+1, -sys.maxsize) - self.assertTrue(isinstance(x, int)) - # should return long + self.assertIsInstance(x, int) + # should return int self.assertEqual(int(s[1:]), sys.maxsize+1) - # should return long + # should return int x = int(1e100) - self.assertTrue(isinstance(x, int)) + self.assertIsInstance(x, int) x = int(-1e100) - self.assertTrue(isinstance(x, int)) + self.assertIsInstance(x, int) # SF bug 434186: 0x80000000/2 != 0x80000000>>1. @@ -79,7 +79,8 @@ class IntTestCases(unittest.TestCase): self.assertRaises(ValueError, int, '123\x00 245', 20) x = int('1' * 600) - self.assertTrue(isinstance(x, int)) + self.assertIsInstance(x, int) + self.assertRaises(TypeError, int, 1, 12) |