mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
use assert[Not]IsInstance where appropriate
This commit is contained in:
parent
f14c7fc33d
commit
b0f5adc3f4
57 changed files with 269 additions and 272 deletions
|
@ -249,8 +249,8 @@ if 1:
|
|||
self.fail("How many bits *does* this machine have???")
|
||||
# Verify treatment of contant folding on -(sys.maxint+1)
|
||||
# i.e. -2147483648 on 32 bit platforms. Should return int, not long.
|
||||
self.assertTrue(isinstance(eval("%s" % (-sys.maxint - 1)), int))
|
||||
self.assertTrue(isinstance(eval("%s" % (-sys.maxint - 2)), long))
|
||||
self.assertIsInstance(eval("%s" % (-sys.maxint - 1)), int)
|
||||
self.assertIsInstance(eval("%s" % (-sys.maxint - 2)), long)
|
||||
|
||||
if sys.maxint == 9223372036854775807:
|
||||
def test_32_63_bit_values(self):
|
||||
|
@ -265,7 +265,7 @@ if 1:
|
|||
|
||||
for variable in self.test_32_63_bit_values.func_code.co_consts:
|
||||
if variable is not None:
|
||||
self.assertTrue(isinstance(variable, int))
|
||||
self.assertIsInstance(variable, int)
|
||||
|
||||
def test_sequence_unpacking_error(self):
|
||||
# Verify sequence packing/unpacking with "or". SF bug #757818
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue