@@ -752,7 +752,7 @@ def test_explicit_context_create_decimal(self):
752752 for v in [- 2 ** 63 - 1 , - 2 ** 63 , - 2 ** 31 - 1 , - 2 ** 31 , 0 ,
753753 2 ** 31 - 1 , 2 ** 31 , 2 ** 63 - 1 , 2 ** 63 ]:
754754 d = nc .create_decimal (v )
755- self .assertTrue ( isinstance ( d , Decimal ) )
755+ self .assertIsInstance ( d , Decimal )
756756 self .assertEqual (int (d ), v )
757757
758758 nc .prec = 3
@@ -2590,8 +2590,8 @@ class PythonAPItests:
25902590 def test_abc (self ):
25912591 Decimal = self .decimal .Decimal
25922592
2593- self .assertTrue ( issubclass ( Decimal , numbers .Number ) )
2594- self .assertFalse ( issubclass ( Decimal , numbers .Real ) )
2593+ self .assertIsSubclass ( Decimal , numbers .Number )
2594+ self .assertNotIsSubclass ( Decimal , numbers .Real )
25952595 self .assertIsInstance (Decimal (0 ), numbers .Number )
25962596 self .assertNotIsInstance (Decimal (0 ), numbers .Real )
25972597
@@ -2690,7 +2690,7 @@ class MyDecimal(Decimal):
26902690 def __init__ (self , _ ):
26912691 self .x = 'y'
26922692
2693- self .assertTrue ( issubclass ( MyDecimal , Decimal ) )
2693+ self .assertIsSubclass ( MyDecimal , Decimal )
26942694
26952695 r = MyDecimal .from_float (0.1 )
26962696 self .assertEqual (type (r ), MyDecimal )
@@ -2908,31 +2908,31 @@ def test_exception_hierarchy(self):
29082908 Rounded = decimal .Rounded
29092909 Clamped = decimal .Clamped
29102910
2911- self .assertTrue ( issubclass ( DecimalException , ArithmeticError ) )
2912-
2913- self .assertTrue ( issubclass ( InvalidOperation , DecimalException ) )
2914- self .assertTrue ( issubclass ( FloatOperation , DecimalException ) )
2915- self .assertTrue ( issubclass ( FloatOperation , TypeError ) )
2916- self .assertTrue ( issubclass ( DivisionByZero , DecimalException ) )
2917- self .assertTrue ( issubclass ( DivisionByZero , ZeroDivisionError ) )
2918- self .assertTrue ( issubclass ( Overflow , Rounded ) )
2919- self .assertTrue ( issubclass ( Overflow , Inexact ) )
2920- self .assertTrue ( issubclass ( Overflow , DecimalException ) )
2921- self .assertTrue ( issubclass ( Underflow , Inexact ) )
2922- self .assertTrue ( issubclass ( Underflow , Rounded ) )
2923- self .assertTrue ( issubclass ( Underflow , Subnormal ) )
2924- self .assertTrue ( issubclass ( Underflow , DecimalException ) )
2925-
2926- self .assertTrue ( issubclass ( Subnormal , DecimalException ) )
2927- self .assertTrue ( issubclass ( Inexact , DecimalException ) )
2928- self .assertTrue ( issubclass ( Rounded , DecimalException ) )
2929- self .assertTrue ( issubclass ( Clamped , DecimalException ) )
2930-
2931- self .assertTrue ( issubclass ( decimal .ConversionSyntax , InvalidOperation ) )
2932- self .assertTrue ( issubclass ( decimal .DivisionImpossible , InvalidOperation ) )
2933- self .assertTrue ( issubclass ( decimal .DivisionUndefined , InvalidOperation ) )
2934- self .assertTrue ( issubclass ( decimal .DivisionUndefined , ZeroDivisionError ) )
2935- self .assertTrue ( issubclass ( decimal .InvalidContext , InvalidOperation ) )
2911+ self .assertIsSubclass ( DecimalException , ArithmeticError )
2912+
2913+ self .assertIsSubclass ( InvalidOperation , DecimalException )
2914+ self .assertIsSubclass ( FloatOperation , DecimalException )
2915+ self .assertIsSubclass ( FloatOperation , TypeError )
2916+ self .assertIsSubclass ( DivisionByZero , DecimalException )
2917+ self .assertIsSubclass ( DivisionByZero , ZeroDivisionError )
2918+ self .assertIsSubclass ( Overflow , Rounded )
2919+ self .assertIsSubclass ( Overflow , Inexact )
2920+ self .assertIsSubclass ( Overflow , DecimalException )
2921+ self .assertIsSubclass ( Underflow , Inexact )
2922+ self .assertIsSubclass ( Underflow , Rounded )
2923+ self .assertIsSubclass ( Underflow , Subnormal )
2924+ self .assertIsSubclass ( Underflow , DecimalException )
2925+
2926+ self .assertIsSubclass ( Subnormal , DecimalException )
2927+ self .assertIsSubclass ( Inexact , DecimalException )
2928+ self .assertIsSubclass ( Rounded , DecimalException )
2929+ self .assertIsSubclass ( Clamped , DecimalException )
2930+
2931+ self .assertIsSubclass ( decimal .ConversionSyntax , InvalidOperation )
2932+ self .assertIsSubclass ( decimal .DivisionImpossible , InvalidOperation )
2933+ self .assertIsSubclass ( decimal .DivisionUndefined , InvalidOperation )
2934+ self .assertIsSubclass ( decimal .DivisionUndefined , ZeroDivisionError )
2935+ self .assertIsSubclass ( decimal .InvalidContext , InvalidOperation )
29362936
29372937@requires_cdecimal
29382938class CPythonAPItests (PythonAPItests , unittest .TestCase ):
0 commit comments