Commit 708a5ea9 authored by Serhiy Storchaka's avatar Serhiy Storchaka

Issue #20546: Use specific asserts in int tests.

parent ca00c6ea
...@@ -90,7 +90,7 @@ class LongTest(test_int.IntLongCommonTests, unittest.TestCase): ...@@ -90,7 +90,7 @@ class LongTest(test_int.IntLongCommonTests, unittest.TestCase):
# The sign of the number is also random. # The sign of the number is also random.
def getran(self, ndigits): def getran(self, ndigits):
self.assertTrue(ndigits > 0) self.assertGreater(ndigits, 0)
nbits_hi = ndigits * SHIFT nbits_hi = ndigits * SHIFT
nbits_lo = nbits_hi - SHIFT + 1 nbits_lo = nbits_hi - SHIFT + 1
answer = 0L answer = 0L
...@@ -588,7 +588,7 @@ class LongTest(test_int.IntLongCommonTests, unittest.TestCase): ...@@ -588,7 +588,7 @@ class LongTest(test_int.IntLongCommonTests, unittest.TestCase):
pass pass
x = long2(1L<<100) x = long2(1L<<100)
y = int(x) y = int(x)
self.assertTrue(type(y) is long, self.assertIs(type(y), long,
"overflowing int conversion must return long not long subtype") "overflowing int conversion must return long not long subtype")
# long -> Py_ssize_t conversion # long -> Py_ssize_t conversion
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment