mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +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
|
@ -521,7 +521,7 @@ class DecimalExplicitConstructionTest(unittest.TestCase):
|
|||
|
||||
# from int
|
||||
d = nc.create_decimal(456)
|
||||
self.assertTrue(isinstance(d, Decimal))
|
||||
self.assertIsInstance(d, Decimal)
|
||||
self.assertEqual(nc.create_decimal(45678),
|
||||
nc.create_decimal('457E+2'))
|
||||
|
||||
|
@ -1529,7 +1529,7 @@ class DecimalPythonAPItests(unittest.TestCase):
|
|||
def test_abc(self):
|
||||
self.assertTrue(issubclass(Decimal, numbers.Number))
|
||||
self.assertTrue(not issubclass(Decimal, numbers.Real))
|
||||
self.assertTrue(isinstance(Decimal(0), numbers.Number))
|
||||
self.assertIsInstance(Decimal(0), numbers.Number)
|
||||
self.assertTrue(not isinstance(Decimal(0), numbers.Real))
|
||||
|
||||
def test_pickle(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue