@@ -752,7 +752,7 @@ def test_explicit_context_create_decimal(self):
752
752
for v in [- 2 ** 63 - 1 , - 2 ** 63 , - 2 ** 31 - 1 , - 2 ** 31 , 0 ,
753
753
2 ** 31 - 1 , 2 ** 31 , 2 ** 63 - 1 , 2 ** 63 ]:
754
754
d = nc .create_decimal (v )
755
- self .assertTrue ( isinstance ( d , Decimal ) )
755
+ self .assertIsInstance ( d , Decimal )
756
756
self .assertEqual (int (d ), v )
757
757
758
758
nc .prec = 3
@@ -2590,8 +2590,8 @@ class PythonAPItests:
2590
2590
def test_abc (self ):
2591
2591
Decimal = self .decimal .Decimal
2592
2592
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 )
2595
2595
self .assertIsInstance (Decimal (0 ), numbers .Number )
2596
2596
self .assertNotIsInstance (Decimal (0 ), numbers .Real )
2597
2597
@@ -2690,7 +2690,7 @@ class MyDecimal(Decimal):
2690
2690
def __init__ (self , _ ):
2691
2691
self .x = 'y'
2692
2692
2693
- self .assertTrue ( issubclass ( MyDecimal , Decimal ) )
2693
+ self .assertIsSubclass ( MyDecimal , Decimal )
2694
2694
2695
2695
r = MyDecimal .from_float (0.1 )
2696
2696
self .assertEqual (type (r ), MyDecimal )
@@ -2908,31 +2908,31 @@ def test_exception_hierarchy(self):
2908
2908
Rounded = decimal .Rounded
2909
2909
Clamped = decimal .Clamped
2910
2910
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 )
2936
2936
2937
2937
@requires_cdecimal
2938
2938
class CPythonAPItests (PythonAPItests , unittest .TestCase ):
0 commit comments