]> granicus.if.org Git - python/commitdiff
Issue #20546: Use specific asserts in int tests.
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 8 Feb 2014 12:28:20 +0000 (14:28 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Sat, 8 Feb 2014 12:28:20 +0000 (14:28 +0200)
Lib/test/test_long.py

index f0847e7ab4374b95d46b828ac7dae5b740ce36f7..8d16bb03875c1f10f06bd8e153050162c01abc6d 100644 (file)
@@ -90,7 +90,7 @@ class LongTest(test_int.IntLongCommonTests, unittest.TestCase):
     # The sign of the number is also random.
 
     def getran(self, ndigits):
-        self.assertTrue(ndigits > 0)
+        self.assertGreater(ndigits, 0)
         nbits_hi = ndigits * SHIFT
         nbits_lo = nbits_hi - SHIFT + 1
         answer = 0L
@@ -588,7 +588,7 @@ class LongTest(test_int.IntLongCommonTests, unittest.TestCase):
             pass
         x = long2(1L<<100)
         y = int(x)
-        self.assertTrue(type(y) is long,
+        self.assertIs(type(y), long,
             "overflowing int conversion must return long not long subtype")
 
         # long -> Py_ssize_t conversion