• Home
  • Raw
  • Download

Lines Matching refs:assertRaises

517         self.assertRaises(TypeError, Decimal, None)
584 self.assertRaises(InvalidOperation, Decimal, "xyz")
586 self.assertRaises(TypeError, Decimal, "1234", "x", "y")
589 self.assertRaises(InvalidOperation, Decimal, "1\u00a02\u00a03")
590 self.assertRaises(InvalidOperation, Decimal, "\u00a01\u00a02\u00a0")
593 self.assertRaises(InvalidOperation, Decimal, "\u00a0")
594 self.assertRaises(InvalidOperation, Decimal, "\u00a0\u00a0")
597 self.assertRaises(InvalidOperation, Decimal, "12\u00003")
600 self.assertRaises(InvalidOperation, Decimal, "1_2_\u00003")
638 self.assertRaises(ValueError, Decimal, (1, (4, 3, 4, 9, 1)) )
641 self.assertRaises(ValueError, Decimal, (8, (4, 3, 4, 9, 1), 2) )
642 self.assertRaises(ValueError, Decimal, (0., (4, 3, 4, 9, 1), 2) )
643 self.assertRaises(ValueError, Decimal, (Decimal(1), (4, 3, 4, 9, 1), 2))
646 self.assertRaises(ValueError, Decimal, (1, (4, 3, 4, 9, 1), 'wrong!') )
647 self.assertRaises(ValueError, Decimal, (1, (4, 3, 4, 9, 1), 0.) )
648 self.assertRaises(ValueError, Decimal, (1, (4, 3, 4, 9, 1), '1') )
651 self.assertRaises(ValueError, Decimal, (1, "xyz", 2) )
652 self.assertRaises(ValueError, Decimal, (1, (4, 3, 4, None, 1), 2) )
653 self.assertRaises(ValueError, Decimal, (1, (4, -3, 4, 9, 1), 2) )
654 self.assertRaises(ValueError, Decimal, (1, (4, 10, 4, 9, 1), 2) )
655 self.assertRaises(ValueError, Decimal, (1, (4, 3, 4, 'a', 1), 2) )
742 self.assertRaises(TypeError, nc.create_decimal, None)
785 self.assertRaises(Rounded, nc.create_decimal, 1234)
795 self.assertRaises(InvalidOperation, nc.create_decimal, "xyz")
796 self.assertRaises(ValueError, nc.create_decimal, (1, "xyz", -25))
797 self.assertRaises(TypeError, nc.create_decimal, "1234", "5678")
799 self.assertRaises(InvalidOperation, nc.create_decimal, " 1234")
800 self.assertRaises(InvalidOperation, nc.create_decimal, "12_34")
804 self.assertRaises(InvalidOperation, nc.create_decimal, 'NaN12345')
805 self.assertRaises(InvalidOperation, nc.create_decimal,
861 self.assertRaises(TypeError, eval, 'Decimal(5) + None', locals())
873 self.assertRaises(TypeError, eval, 'Decimal(5) + "3"', locals())
877 self.assertRaises(TypeError, eval, 'Decimal(5) + 2.2', locals())
1097 self.assertRaises(TypeError, Decimal(1).__format__, b'-020')
1501 self.assertRaises(InvalidOperation, operator.eq, x, y)
1502 self.assertRaises(InvalidOperation, operator.ne, x, y)
1506 self.assertRaises(InvalidOperation, op, x, y)
1513 self.assertRaises(TypeError, Decimal(1).copy_sign, '-2')
1542 cls.assertRaises(DivisionByZero, c2.divide, d1, 0)
1547 cls.assertRaises(InvalidOperation, c3.compare, d1, Decimal('sNaN'))
1581 cls.assertRaises(Overflow, c2.multiply, Decimal('1e425000000'), 999)
1587 cls.assertRaises(Underflow, c3.divide, Decimal('1e-425000000'), 999)
1771 self.assertRaises(InvalidOperation, D('nan').__gt__, F(-9,123))
1865 self.assertRaises(TypeError, hash, Decimal('sNaN'))
1941 self.assertRaises(ValueError, math.floor, Decimal('-NaN'))
1942 self.assertRaises(ValueError, math.floor, Decimal('sNaN'))
1943 self.assertRaises(ValueError, math.floor, Decimal('NaN123'))
1944 self.assertRaises(OverflowError, math.floor, Decimal('Inf'))
1945 self.assertRaises(OverflowError, math.floor, Decimal('-Inf'))
1961 self.assertRaises(ValueError, math.ceil, Decimal('-NaN'))
1962 self.assertRaises(ValueError, math.ceil, Decimal('sNaN'))
1963 self.assertRaises(ValueError, math.ceil, Decimal('NaN123'))
1964 self.assertRaises(OverflowError, math.ceil, Decimal('Inf'))
1965 self.assertRaises(OverflowError, math.ceil, Decimal('-Inf'))
1988 self.assertRaises(ValueError, round, Decimal('-NaN'))
1989 self.assertRaises(ValueError, round, Decimal('sNaN'))
1990 self.assertRaises(ValueError, round, Decimal('NaN123'))
1991 self.assertRaises(OverflowError, round, Decimal('Inf'))
1992 self.assertRaises(OverflowError, round, Decimal('-Inf'))
2029 self.assertRaises(ValueError, float, d)
2099 self.assertRaises(OverflowError,
2101 self.assertRaises(OverflowError,
2103 self.assertRaises(ValueError,
2105 self.assertRaises(ValueError,
2212 self.assertRaises(Overflow, y.exp, context=None)
2223 self.assertRaises(InvalidOperation, Decimal(-1).ln, context=None)
2231 self.assertRaises(InvalidOperation, Decimal(-1).log10, context=None)
2236 self.assertRaises(DivisionByZero, Decimal(0).logb, context=None)
2241 self.assertRaises(InvalidOperation, y.logical_invert, context=None)
2246 self.assertRaises(InvalidOperation, Decimal('sNaN').next_minus, context=None)
2251 self.assertRaises(InvalidOperation, Decimal('sNaN').next_plus, context=None)
2256 self.assertRaises(Overflow, y.normalize, context=None)
2269 self.assertRaises(Overflow, y.sqrt, context=None)
2281 self.assertRaises(InvalidOperation, x.compare, Decimal('sNaN'), context=None)
2287 self.assertRaises(InvalidOperation, x.compare_signal, Decimal('NaN'), context=None)
2293 self.assertRaises(InvalidOperation, x.logical_and, 123, context=None)
2299 self.assertRaises(InvalidOperation, x.logical_or, 123, context=None)
2305 self.assertRaises(InvalidOperation, x.logical_xor, 123, context=None)
2311 self.assertRaises(InvalidOperation, x.max, Decimal('sNaN'), context=None)
2317 self.assertRaises(InvalidOperation, x.max_mag, Decimal('sNaN'), context=None)
2323 self.assertRaises(InvalidOperation, x.min, Decimal('sNaN'), context=None)
2329 self.assertRaises(InvalidOperation, x.min_mag, Decimal('sNaN'), context=None)
2335 self.assertRaises(InvalidOperation, y.remainder_near, 101, context=None)
2341 self.assertRaises(InvalidOperation, x.rotate, 101, context=None)
2347 self.assertRaises(InvalidOperation, x.scaleb, 10000, context=None)
2353 self.assertRaises(InvalidOperation, x.shift, 10000, context=None)
2361 self.assertRaises(Overflow, x.fma, Decimal('1e9999'), 3, context=None)
2375 self.assertRaises(InvalidOperation, Decimal('sNaN').to_integral, context=None)
2387 self.assertRaises(InvalidOperation, Decimal('sNaN').to_integral_value, context=None)
2399 self.assertRaises(InvalidOperation, Decimal('sNaN').to_integral_exact, context=None)
2411 … self.assertRaises(InvalidOperation, y.quantize, Decimal('1e-10'), rounding=ROUND_UP, context=None)
2559 self.assertRaises(ValueError, int, Decimal('-nan'))
2560 self.assertRaises(ValueError, int, Decimal('snan'))
2561 self.assertRaises(OverflowError, int, Decimal('inf'))
2562 self.assertRaises(OverflowError, int, Decimal('-inf'))
2603 self.assertRaises(TypeError, MyDecimal.from_float, 'abc')
2624 self.assertRaises(
2650 self.assertRaises(
2671 self.assertRaises(AttributeError, setattr, x, 'real', 100)
2672 self.assertRaises(AttributeError, setattr, x, 'imag', 100)
2673 self.assertRaises(AttributeError, setattr, x, 'conjugate', 100)
2674 self.assertRaises(AttributeError, setattr, x, '__complex__', 100)
2696 self.assertRaises(InvalidOperation, D, "xyz", context=xc)
2702 self.assertRaises(Overflow, D(8).exp, context=xc)
2708 self.assertRaises(InvalidOperation, D(-1).ln, context=xc)
2723 self.assertRaises(InvalidOperation,
2736 self.assertRaises(InvalidOperation,
2746 self.assertRaises(TypeError, D(1).is_canonical, context=xc)
2747 self.assertRaises(TypeError, D(1).is_finite, context=xc)
2748 self.assertRaises(TypeError, D(1).is_infinite, context=xc)
2749 self.assertRaises(TypeError, D(1).is_nan, context=xc)
2750 self.assertRaises(TypeError, D(1).is_qnan, context=xc)
2751 self.assertRaises(TypeError, D(1).is_snan, context=xc)
2752 self.assertRaises(TypeError, D(1).is_signed, context=xc)
2753 self.assertRaises(TypeError, D(1).is_zero, context=xc)
2758 self.assertRaises(TypeError, D(1).adjusted, context=xc)
2759 self.assertRaises(TypeError, D(1).conjugate, context=xc)
2760 self.assertRaises(TypeError, D(1).radix, context=xc)
2773 self.assertRaises(Overflow,
2779 self.assertRaises(TypeError, D.from_float, 1.1, context=xc)
2780 self.assertRaises(TypeError, D(0).as_tuple, context=xc)
2783 self.assertRaises(TypeError, D("-1").copy_abs, context=xc)
2784 self.assertRaises(TypeError, D("-1").copy_negate, context=xc)
2785 self.assertRaises(TypeError, D(1).canonical, context="x")
2786 self.assertRaises(TypeError, D(1).canonical, xyz="x")
2867 self.assertRaises(TypeError, setattr, c, 'rounding', s)
2870 self.assertRaises(TypeError, setattr, c, 'rounding', s)
2963 self.assertRaises(AttributeError, getattr, c, '_clamp')
2972 self.assertRaises(TypeError, c.abs, '-1')
2983 self.assertRaises(TypeError, c.add, '1', 1)
2984 self.assertRaises(TypeError, c.add, 1, '1')
2995 self.assertRaises(TypeError, c.compare, '1', 1)
2996 self.assertRaises(TypeError, c.compare, 1, '1')
3007 self.assertRaises(TypeError, c.compare_signal, '1', 1)
3008 self.assertRaises(TypeError, c.compare_signal, 1, '1')
3019 self.assertRaises(TypeError, c.compare_total, '1', 1)
3020 self.assertRaises(TypeError, c.compare_total, 1, '1')
3031 self.assertRaises(TypeError, c.compare_total_mag, '1', 1)
3032 self.assertRaises(TypeError, c.compare_total_mag, 1, '1')
3041 self.assertRaises(TypeError, c.copy_abs, '-1')
3050 self.assertRaises(TypeError, c.copy_decimal, '-1')
3059 self.assertRaises(TypeError, c.copy_negate, '-1')
3070 self.assertRaises(TypeError, c.copy_sign, '1', -2)
3071 self.assertRaises(TypeError, c.copy_sign, 1, '-2')
3082 self.assertRaises(TypeError, c.divide, '1', 2)
3083 self.assertRaises(TypeError, c.divide, 1, '2')
3094 self.assertRaises(TypeError, c.divide_int, '1', 2)
3095 self.assertRaises(TypeError, c.divide_int, 1, '2')
3106 self.assertRaises(TypeError, c.divmod, '1', 2)
3107 self.assertRaises(TypeError, c.divmod, 1, '2')
3116 self.assertRaises(TypeError, c.exp, '10')
3129 self.assertRaises(TypeError, c.fma, '2', 3, 4)
3130 self.assertRaises(TypeError, c.fma, 2, '3', 4)
3131 self.assertRaises(TypeError, c.fma, 2, 3, '4')
3134 self.assertRaises(TypeError, c.fma,
3136 self.assertRaises(TypeError, c.fma,
3139 self.assertRaises(TypeError, Decimal('Infinity').fma,
3141 self.assertRaises(TypeError, Decimal(1).fma,
3151 self.assertRaises(TypeError, c.is_finite, '10')
3160 self.assertRaises(TypeError, c.is_infinite, '10')
3169 self.assertRaises(TypeError, c.is_nan, '10')
3178 self.assertRaises(TypeError, c.is_normal, '10')
3187 self.assertRaises(TypeError, c.is_qnan, '10')
3196 self.assertRaises(TypeError, c.is_signed, '10')
3205 self.assertRaises(TypeError, c.is_snan, '10')
3214 self.assertRaises(TypeError, c.is_subnormal, '10')
3223 self.assertRaises(TypeError, c.is_zero, '10')
3232 self.assertRaises(TypeError, c.ln, '10')
3241 self.assertRaises(TypeError, c.log10, '10')
3250 self.assertRaises(TypeError, c.logb, '10')
3261 self.assertRaises(TypeError, c.logical_and, '1', 1)
3262 self.assertRaises(TypeError, c.logical_and, 1, '1')
3271 self.assertRaises(TypeError, c.logical_invert, '1000')
3282 self.assertRaises(TypeError, c.logical_or, '1', 1)
3283 self.assertRaises(TypeError, c.logical_or, 1, '1')
3294 self.assertRaises(TypeError, c.logical_xor, '1', 1)
3295 self.assertRaises(TypeError, c.logical_xor, 1, '1')
3306 self.assertRaises(TypeError, c.max, '1', 2)
3307 self.assertRaises(TypeError, c.max, 1, '2')
3318 self.assertRaises(TypeError, c.max_mag, '1', 2)
3319 self.assertRaises(TypeError, c.max_mag, 1, '2')
3330 self.assertRaises(TypeError, c.min, '1', 2)
3331 self.assertRaises(TypeError, c.min, 1, '2')
3342 self.assertRaises(TypeError, c.min_mag, '1', 2)
3343 self.assertRaises(TypeError, c.min_mag, 1, '2')
3352 self.assertRaises(TypeError, c.minus, '10')
3363 self.assertRaises(TypeError, c.multiply, '1', 2)
3364 self.assertRaises(TypeError, c.multiply, 1, '2')
3373 self.assertRaises(TypeError, c.next_minus, '10')
3382 self.assertRaises(TypeError, c.next_plus, '10')
3393 self.assertRaises(TypeError, c.next_toward, '1', 2)
3394 self.assertRaises(TypeError, c.next_toward, 1, '2')
3403 self.assertRaises(TypeError, c.normalize, '10')
3421 self.assertRaises(TypeError, c.plus, '10')
3433 self.assertRaises(TypeError, c.power, '1', 4)
3434 self.assertRaises(TypeError, c.power, 1, '4')
3446 self.assertRaises(TypeError, c.quantize, '1', 2)
3447 self.assertRaises(TypeError, c.quantize, 1, '2')
3458 self.assertRaises(TypeError, c.remainder, '1', 2)
3459 self.assertRaises(TypeError, c.remainder, 1, '2')
3470 self.assertRaises(TypeError, c.remainder_near, '1', 2)
3471 self.assertRaises(TypeError, c.remainder_near, 1, '2')
3482 self.assertRaises(TypeError, c.rotate, '1', 2)
3483 self.assertRaises(TypeError, c.rotate, 1, '2')
3492 self.assertRaises(TypeError, c.sqrt, '10')
3503 self.assertRaises(TypeError, c.same_quantum, '1', 2)
3504 self.assertRaises(TypeError, c.same_quantum, 1, '2')
3515 self.assertRaises(TypeError, c.scaleb, '1', 2)
3516 self.assertRaises(TypeError, c.scaleb, 1, '2')
3527 self.assertRaises(TypeError, c.shift, '1', 2)
3528 self.assertRaises(TypeError, c.shift, 1, '2')
3539 self.assertRaises(TypeError, c.subtract, '1', 2)
3540 self.assertRaises(TypeError, c.subtract, 1, '2')
3549 self.assertRaises(TypeError, c.to_eng_string, '10')
3558 self.assertRaises(TypeError, c.to_sci_string, '10')
3567 self.assertRaises(TypeError, c.to_integral_exact, '10')
3576 self.assertRaises(TypeError, c.to_integral_value, '10')
3577 self.assertRaises(TypeError, c.to_integral_value, 10, 'x')
3636 self.assertRaises(Clamped, c1.create_decimal, '0e-999')
3641 self.assertRaises(Overflow, c2.power, Decimal('3.4e200'), 2)
3859 self.assertRaises(FloatOperation, Decimal, 7.5)
3863 self.assertRaises(FloatOperation, c.create_decimal, 7.5)
3885 self.assertRaises(signal, f, b)
3943 self.assertRaises(signal, sorted, [1.0, Decimal('10.0')])
4084 self.assertRaises(ValueError, setattr, c, attr, -1)
4085 self.assertRaises(TypeError, setattr, c, attr, 'xyz')
4090 self.assertRaises(ValueError, setattr, c, 'Emin', 1)
4091 self.assertRaises(TypeError, setattr, c, 'Emin', (1,2,3))
4093 self.assertRaises(TypeError, setattr, c, 'rounding', -1)
4094 self.assertRaises(TypeError, setattr, c, 'rounding', 9)
4095 self.assertRaises(TypeError, setattr, c, 'rounding', 1.0)
4096 self.assertRaises(TypeError, setattr, c, 'rounding', 'xyz')
4100 self.assertRaises(ValueError, setattr, c, attr, -1)
4101 self.assertRaises(ValueError, setattr, c, attr, 2)
4102 self.assertRaises(TypeError, setattr, c, attr, [1,2,3])
4105 self.assertRaises(AttributeError, setattr, c, 'emax', 100)
4108 self.assertRaises(TypeError, setattr, c, 'flags', [])
4109 self.assertRaises(KeyError, setattr, c, 'flags', {})
4110 self.assertRaises(KeyError, setattr, c, 'traps',
4116 self.assertRaises(AttributeError, c.__delattr__, attr)
4119 self.assertRaises(TypeError, getattr, c, 9)
4120 self.assertRaises(TypeError, setattr, c, 9)
4123 self.assertRaises(TypeError, Context, rounding=999999)
4124 self.assertRaises(TypeError, Context, rounding='xyz')
4125 self.assertRaises(ValueError, Context, clamp=2)
4126 self.assertRaises(ValueError, Context, capitals=-1)
4127 self.assertRaises(KeyError, Context, flags=["P"])
4128 self.assertRaises(KeyError, Context, traps=["Q"])
4131 self.assertRaises(TypeError, Context, flags=(0,1))
4132 self.assertRaises(TypeError, Context, traps=(1,0))
4187 self.assertRaises(ValueError, MyContext, **{'prec':-1})
4190 self.assertRaises(InvalidOperation, c.quantize, Decimal('9e2'), 0)
4193 self.assertRaises(TypeError, MyContext, **{'rounding':'XYZ'})
4199 self.assertRaises(ValueError, MyContext, **{'Emin':5})
4208 self.assertRaises(ValueError, MyContext, **{'Emax':-1})
4211 self.assertRaises(Overflow, c.add, Decimal('1e99'), Decimal('2.234e2000'))
4217 self.assertRaises(ValueError, MyContext, **{'capitals':-1})
4224 self.assertRaises(ValueError, MyContext, **{'clamp':2})
4231 self.assertRaises(TypeError, MyContext, **{'flags':'XYZ'})
4240 self.assertRaises(TypeError, MyContext, **{'traps':'XYZ'})
4507 self.assertRaises(TypeError, Decimal("1.23").__round__, "5")
4508 self.assertRaises(TypeError, Decimal("1.23").__round__, 5, 8)
4512 self.assertRaises(ValueError, c.create_decimal, ["%"])
4708 self.assertRaises(ValueError, Decimal("3.1234")._round, 0, ROUND_UP)
4745 self.assertRaises(OverflowError, IEEEContext, 2**63)
4746 self.assertRaises(ValueError, IEEEContext, -1)
4747 self.assertRaises(ValueError, IEEEContext, 1024)
4816 self.assertRaises(TypeError, C.Decimal, 9, "xyz")
4826 self.assertRaises(InvalidOperation, Decimal,
4871 self.assertRaises(KeyError, c.flags.__setitem__, 801, 0)
4872 self.assertRaises(KeyError, c.traps.__setitem__, 801, 0)
4873 self.assertRaises(ValueError, c.flags.__delitem__, Overflow)
4874 self.assertRaises(ValueError, c.traps.__delitem__, InvalidOperation)
4875 self.assertRaises(TypeError, setattr, c, 'flags', ['x'])
4876 self.assertRaises(TypeError, setattr, c,'traps', ['y'])
4877 self.assertRaises(KeyError, setattr, c, 'flags', {0:1})
4878 self.assertRaises(KeyError, setattr, c, 'traps', {0:1})
4885 self.assertRaises(KeyError, setattr, c, 'flags', d)
4886 self.assertRaises(KeyError, setattr, c, 'traps', d)
4894 self.assertRaises(ValueError, setattr, c, attr, gt_max_emax)
4895 self.assertRaises(ValueError, setattr, c, 'Emin', -gt_max_emax)
4898 self.assertRaises(ValueError, Context, prec=gt_max_emax)
4899 self.assertRaises(ValueError, Context, Emax=gt_max_emax)
4900 self.assertRaises(ValueError, Context, Emin=-gt_max_emax)
4903 self.assertRaises(OverflowError, Context, prec=int_max+1)
4904 self.assertRaises(OverflowError, Context, Emax=int_max+1)
4905 self.assertRaises(OverflowError, Context, Emin=-int_max-2)
4906 self.assertRaises(OverflowError, Context, clamp=int_max+1)
4907 self.assertRaises(OverflowError, Context, capitals=int_max+1)
4911 self.assertRaises(OverflowError, setattr, c, attr, int_max+1)
4912 self.assertRaises(OverflowError, setattr, c, attr, -int_max-2)
4914 self.assertRaises(ValueError, setattr, c, attr, int_max)
4915 self.assertRaises(ValueError, setattr, c, attr, -int_max-1)
4919 self.assertRaises(OverflowError, getattr(c, '_unsafe_setprec'),
4921 self.assertRaises(OverflowError, getattr(c, '_unsafe_setemax'),
4923 self.assertRaises(OverflowError, getattr(c, '_unsafe_setemin'),
4928 self.assertRaises(ValueError, getattr(c, '_unsafe_setprec'), 0)
4929 self.assertRaises(ValueError, getattr(c, '_unsafe_setprec'),
4931 self.assertRaises(ValueError, getattr(c, '_unsafe_setemax'), -1)
4932 self.assertRaises(ValueError, getattr(c, '_unsafe_setemax'),
4934 self.assertRaises(ValueError, getattr(c, '_unsafe_setemin'),
4936 self.assertRaises(ValueError, getattr(c, '_unsafe_setemin'), 1)
4940 self.assertRaises(ValueError, setattr, c, attr, -1)
4941 self.assertRaises(ValueError, setattr, c, attr, 2)
4942 self.assertRaises(TypeError, setattr, c, attr, [1,2,3])
4944 self.assertRaises(ValueError, setattr, c, attr, 2**32)
4945 self.assertRaises(ValueError, setattr, c, attr, 2**32+1)
4948 self.assertRaises(TypeError, exec, 'with localcontext("xyz"): pass',
4950 self.assertRaises(TypeError, exec,
4956 self.assertRaises(TypeError, setcontext, "xyz")
4986 self.assertRaises(OverflowError, setattr, c, '_allcr', int_max+1)
4987 self.assertRaises(OverflowError, setattr, c, '_allcr', -int_max-2)
4989 self.assertRaises(ValueError, setattr, c, '_allcr', int_max)
4990 self.assertRaises(ValueError, setattr, c, '_allcr', -int_max-1)
4994 self.assertRaises(OverflowError, setattr, c, attr, int_max+1)
4995 self.assertRaises(OverflowError, setattr, c, attr, -int_max-2)
4997 self.assertRaises(TypeError, setattr, c, attr, int_max)
4998 self.assertRaises(TypeError, setattr, c, attr, -int_max-1)
5001 self.assertRaises(ValueError, setattr, c, '_allcr', -1)
5002 self.assertRaises(ValueError, setattr, c, '_allcr', 2)
5003 self.assertRaises(TypeError, setattr, c, '_allcr', [1,2,3])
5005 self.assertRaises(ValueError, setattr, c, '_allcr', 2**32)
5006 self.assertRaises(ValueError, setattr, c, '_allcr', 2**32+1)
5010 self.assertRaises(TypeError, setattr, c, attr, 999999)
5011 self.assertRaises(TypeError, setattr, c, attr, 'x')
5071 self.assertRaises(InvalidOperation, Decimal("1.23").__round__,
5073 self.assertRaises(InvalidOperation, Decimal("1.23").__round__,
5075 self.assertRaises(InvalidOperation, Decimal("1").__round__,
5077 self.assertRaises(C.InvalidOperation, Decimal("1").__round__,
5079 self.assertRaises(OverflowError, Decimal("1.23").__round__,
5081 self.assertRaises(OverflowError, Decimal("1.23").__round__,
5089 self.assertRaises(TypeError, Decimal(1).__format__, "=10.10", [], 9)
5090 self.assertRaises(TypeError, Decimal(1).__format__, "=10.10", 9)
5091 self.assertRaises(TypeError, Decimal(1).__format__, [])
5093 self.assertRaises(ValueError, Decimal(1).__format__, "<>=10.10")
5095 self.assertRaises(ValueError, Decimal("1.23456789").__format__,
5105 self.assertRaises(TypeError, x.to_integral, '10')
5106 self.assertRaises(TypeError, x.to_integral, 10, 'x')
5107 self.assertRaises(TypeError, x.to_integral, 10)
5110 self.assertRaises(TypeError, x.to_integral_value, '10')
5111 self.assertRaises(TypeError, x.to_integral_value, 10, 'x')
5112 self.assertRaises(TypeError, x.to_integral_value, 10)
5115 self.assertRaises(TypeError, x.to_integral_exact, '10')
5116 self.assertRaises(TypeError, x.to_integral_exact, 10, 'x')
5117 self.assertRaises(TypeError, x.to_integral_exact, 10)
5127 self.assertRaises(Inexact, Decimal("999.9").to_integral_exact, ROUND_UP)
5139 self.assertRaises(TypeError, pow, Decimal(1), 2, "3")
5140 self.assertRaises(TypeError, Decimal(9).number_class, "x", "y")
5141 self.assertRaises(TypeError, Decimal(9).same_quantum, 3, "x", "y")
5143 self.assertRaises(
5147 self.assertRaises(
5151 self.assertRaises(
5155 self.assertRaises(
5164 self.assertRaises(TypeError, c.copy_sign, Decimal(1), "x", "y")
5165 self.assertRaises(TypeError, c.canonical, 200)
5166 self.assertRaises(TypeError, c.is_canonical, 200)
5167 self.assertRaises(TypeError, c.divmod, 9, 8, "x", "y")
5168 self.assertRaises(TypeError, c.same_quantum, 9, 3, "x", "y")
5174 self.assertRaises(DivisionByZero, Decimal(9).__divmod__, 0)
5175 self.assertRaises(DivisionByZero, c.divmod, 9, 0)
5180 self.assertRaises(InvalidOperation, Decimal(9).__divmod__, 0)
5181 self.assertRaises(InvalidOperation, c.divmod, 9, 0)
5186 self.assertRaises(InvalidOperation, pow, Decimal(1000), 1, 501)
5198 self.assertRaises(TypeError, func, context="x")
5199 self.assertRaises(TypeError, func, "x", context=None)
5205 self.assertRaises(TypeError, func, context="x")
5206 self.assertRaises(TypeError, func, "x", context=None)
5208 self.assertRaises(TypeError, x.to_integral, rounding=None, context=[])
5209 self.assertRaises(TypeError, x.to_integral, rounding={}, context=[])
5210 self.assertRaises(TypeError, x.to_integral, [], [])
5212 self.assertRaises(TypeError, x.to_integral_value, rounding=None, context=[])
5213 self.assertRaises(TypeError, x.to_integral_value, rounding={}, context=[])
5214 self.assertRaises(TypeError, x.to_integral_value, [], [])
5216 self.assertRaises(TypeError, x.to_integral_exact, rounding=None, context=[])
5217 self.assertRaises(TypeError, x.to_integral_exact, rounding={}, context=[])
5218 self.assertRaises(TypeError, x.to_integral_exact, [], [])
5220 self.assertRaises(TypeError, x.fma, 1, 2, context="x")
5221 self.assertRaises(TypeError, x.fma, 1, 2, "x", context=None)
5223 self.assertRaises(TypeError, x.quantize, 1, [], context=None)
5224 self.assertRaises(TypeError, x.quantize, 1, [], rounding=None)
5225 self.assertRaises(TypeError, x.quantize, 1, [], [])
5228 self.assertRaises(TypeError, c.power, 1, 2, mod="x")
5229 self.assertRaises(TypeError, c.power, 1, "x", mod=None)
5230 self.assertRaises(TypeError, c.power, "x", 2, mod=None)
5288 self.assertRaises(TypeError, c.flags.get, "x", "y", "z")
5409 self.assertRaises(ValueError, get_fmt, 12345,
5412 self.assertRaises(ValueError, get_fmt, 12345, invalid_dot, 'g')
5413 self.assertRaises(ValueError, get_fmt, 12345, invalid_sep, 'g')
5426 self.assertRaises(InvalidOperation, Decimal, x)
5429 self.assertRaises(InvalidOperation, Decimal, x)
5433 self.assertRaises(InvalidOperation, Decimal, x)
5437 self.assertRaises(InvalidOperation, Decimal, x)
5455 self.assertRaises(InvalidOperation, Decimal, x)
5458 self.assertRaises(Overflow, c.create_decimal, x)
5459 self.assertRaises(InvalidOperation, Decimal, x)
5464 self.assertRaises(InvalidOperation, Decimal, x)
5467 self.assertRaises(Underflow, c.create_decimal, x)
5468 self.assertRaises(InvalidOperation, Decimal, x)
5472 self.assertRaises(OverflowError, c.create_decimal, x)
5473 self.assertRaises(OverflowError, Decimal, x)
5476 self.assertRaises(OverflowError, c.create_decimal, x)
5477 self.assertRaises(OverflowError, Decimal, x)