Lines Matching refs:assertRaises
259 self.assertRaises(TypeError, math.acos)
263 self.assertRaises(ValueError, math.acos, INF)
264 self.assertRaises(ValueError, math.acos, NINF)
265 self.assertRaises(ValueError, math.acos, 1 + eps)
266 self.assertRaises(ValueError, math.acos, -1 - eps)
270 self.assertRaises(TypeError, math.acosh)
273 self.assertRaises(ValueError, math.acosh, 0)
274 self.assertRaises(ValueError, math.acosh, -1)
276 self.assertRaises(ValueError, math.acosh, NINF)
280 self.assertRaises(TypeError, math.asin)
284 self.assertRaises(ValueError, math.asin, INF)
285 self.assertRaises(ValueError, math.asin, NINF)
286 self.assertRaises(ValueError, math.asin, 1 + eps)
287 self.assertRaises(ValueError, math.asin, -1 - eps)
291 self.assertRaises(TypeError, math.asinh)
300 self.assertRaises(TypeError, math.atan)
309 self.assertRaises(TypeError, math.atan)
313 self.assertRaises(ValueError, math.atanh, 1)
314 self.assertRaises(ValueError, math.atanh, -1)
315 self.assertRaises(ValueError, math.atanh, INF)
316 self.assertRaises(ValueError, math.atanh, NINF)
320 self.assertRaises(TypeError, math.atan2)
381 self.assertRaises(TypeError, math.ceil)
406 self.assertRaises(TypeError, math.ceil, TestNoCeil())
410 self.assertRaises(TypeError, math.ceil, t)
411 self.assertRaises(TypeError, math.ceil, t, 0)
421 self.assertRaises(TypeError, math.copysign)
448 self.assertRaises(TypeError, math.cos)
457 self.assertRaises(ValueError, math.cos, INF)
458 self.assertRaises(ValueError, math.cos, NINF)
464 self.assertRaises(TypeError, math.cosh)
472 self.assertRaises(TypeError, math.degrees)
479 self.assertRaises(TypeError, math.exp)
486 self.assertRaises(OverflowError, math.exp, 1000000)
489 self.assertRaises(TypeError, math.fabs)
501 self.assertRaises(ValueError, math.factorial, -1)
502 self.assertRaises(ValueError, math.factorial, -10**100)
505 self.assertRaises(TypeError, math.factorial, 5.0)
506 self.assertRaises(TypeError, math.factorial, 5.2)
507 self.assertRaises(TypeError, math.factorial, -1.0)
508 self.assertRaises(TypeError, math.factorial, -1e100)
509 self.assertRaises(TypeError, math.factorial, decimal.Decimal('5'))
510 self.assertRaises(TypeError, math.factorial, decimal.Decimal('5.2'))
511 self.assertRaises(TypeError, math.factorial, "5")
518 self.assertRaises(OverflowError, math.factorial, 10**100)
519 self.assertRaises(TypeError, math.factorial, 1e100)
522 self.assertRaises(TypeError, math.floor)
545 self.assertRaises(TypeError, math.floor, TestNoFloor())
549 self.assertRaises(TypeError, math.floor, t)
550 self.assertRaises(TypeError, math.floor, t, 0)
553 self.assertRaises(TypeError, math.fmod)
563 self.assertRaises(ValueError, math.fmod, 1., 0.)
564 self.assertRaises(ValueError, math.fmod, INF, 1.)
565 self.assertRaises(ValueError, math.fmod, NINF, 1.)
566 self.assertRaises(ValueError, math.fmod, INF, 0.)
575 self.assertRaises(TypeError, math.frexp)
725 self.assertRaises(TypeError, gcd, 120.0)
726 self.assertRaises(TypeError, gcd, 120.0, 84)
727 self.assertRaises(TypeError, gcd, 120, 84.0)
728 self.assertRaises(TypeError, gcd, 120, 1, 84.0)
766 with self.assertRaises(TypeError): # Reject keyword args
768 with self.assertRaises(TypeError): # Reject values without __float__
771 with self.assertRaises((ValueError, OverflowError)):
927 with self.assertRaises(TypeError): # Reject keyword args
929 with self.assertRaises(TypeError): # Too few args
931 with self.assertRaises(TypeError): # Too many args
933 with self.assertRaises(TypeError): # Scalars not allowed
935 with self.assertRaises(TypeError): # Reject values without __float__
937 with self.assertRaises(ValueError): # Check dimension agree
939 with self.assertRaises(ValueError): # Check dimension agree
941 with self.assertRaises(TypeError): # Rejects invalid types
944 with self.assertRaises((ValueError, OverflowError)):
946 with self.assertRaises((ValueError, OverflowError)):
999 with self.assertRaises(ValueError):
1022 with self.assertRaises(ValueError):
1032 with self.assertRaises(TypeError):
1073 self.assertRaises(TypeError, lcm, 120.0)
1074 self.assertRaises(TypeError, lcm, 120.0, 84)
1075 self.assertRaises(TypeError, lcm, 120, 84.0)
1076 self.assertRaises(TypeError, lcm, 120, 0, 84.0)
1080 self.assertRaises(TypeError, math.ldexp)
1085 self.assertRaises(OverflowError, math.ldexp, 1., 1000000)
1086 self.assertRaises(OverflowError, math.ldexp, -1., 1000000)
1103 self.assertRaises(OverflowError, math.ldexp, 1., n)
1104 self.assertRaises(OverflowError, math.ldexp, -1., n)
1112 self.assertRaises(TypeError, math.log)
1121 self.assertRaises(ValueError, math.log, -1.5)
1122 self.assertRaises(ValueError, math.log, -10**1000)
1123 self.assertRaises(ValueError, math.log, NINF)
1128 self.assertRaises(TypeError, math.log1p)
1131 self.assertRaises(ValueError, math.log1p, -1)
1136 self.assertRaises(TypeError, math.log2)
1148 self.assertRaises(ValueError, math.log2, -1.5)
1149 self.assertRaises(ValueError, math.log2, NINF)
1162 self.assertRaises(TypeError, math.log10)
1167 self.assertRaises(ValueError, math.log10, -1.5)
1168 self.assertRaises(ValueError, math.log10, -10**1000)
1169 self.assertRaises(ValueError, math.log10, NINF)
1174 self.assertRaises(TypeError, math.modf)
1193 self.assertRaises(TypeError, math.pow)
1214 self.assertRaises(ValueError, math.pow, 0., -2.)
1215 self.assertRaises(ValueError, math.pow, 0., -2.3)
1216 self.assertRaises(ValueError, math.pow, 0., -3.)
1217 self.assertRaises(ValueError, math.pow, 0., NINF)
1240 self.assertRaises(ValueError, math.pow, -0., -2.)
1241 self.assertRaises(ValueError, math.pow, -0., -2.3)
1242 self.assertRaises(ValueError, math.pow, -0., -3.)
1243 self.assertRaises(ValueError, math.pow, -0., NINF)
1262 self.assertRaises(ValueError, math.pow, -1., 2.3)
1267 self.assertRaises(ValueError, math.pow, -1., -2.3)
1294 self.assertRaises(ValueError, math.pow, -1., 2.3)
1295 self.assertRaises(ValueError, math.pow, -15., -3.1)
1326 self.assertRaises(ValueError, math.pow, -2.0, -0.5)
1327 self.assertRaises(ValueError, math.pow, -2.0, 0.5)
1342 self.assertRaises(TypeError, math.radians)
1468 with self.assertRaises(ValueError):
1470 with self.assertRaises(ValueError):
1472 with self.assertRaises(ValueError):
1474 with self.assertRaises(ValueError):
1478 self.assertRaises(TypeError, math.sin)
1486 self.assertRaises(ValueError, math.sin, INF)
1487 self.assertRaises(ValueError, math.sin, NINF)
1491 self.assertRaises(TypeError, math.sinh)
1500 self.assertRaises(TypeError, math.sqrt)
1505 self.assertRaises(ValueError, math.sqrt, -1)
1506 self.assertRaises(ValueError, math.sqrt, NINF)
1510 self.assertRaises(TypeError, math.tan)
1518 self.assertRaises(ValueError, math.tan, INF)
1519 self.assertRaises(ValueError, math.tan, NINF)
1523 self.assertRaises(TypeError, math.tanh)
1562 self.assertRaises(TypeError, math.trunc)
1563 self.assertRaises(TypeError, math.trunc, 1, 2)
1564 self.assertRaises(TypeError, math.trunc, FloatLike(23.5))
1565 self.assertRaises(TypeError, math.trunc, TestNoTrunc())
1783 self.assertRaises(TypeError, prod)
1784 self.assertRaises(TypeError, prod, 42)
1785 self.assertRaises(TypeError, prod, ['a', 'b', 'c'])
1786 self.assertRaises(TypeError, prod, ['a', 'b', 'c'], start='')
1787 self.assertRaises(TypeError, prod, [b'a', b'c'], start=b'')
1789 self.assertRaises(TypeError, prod, values, start=bytearray(b''))
1790 self.assertRaises(TypeError, prod, [[1], [2], [3]])
1791 self.assertRaises(TypeError, prod, [{2:3}])
1792 self.assertRaises(TypeError, prod, [{2:3}]*2, start={2:3})
1793 self.assertRaises(TypeError, prod, [[1], [2], [3]], start=[])
1800 with self.assertRaises(TypeError):
1884 self.assertRaises(TypeError, perm, 10, 1.0)
1885 self.assertRaises(TypeError, perm, 10, decimal.Decimal(1.0))
1886 self.assertRaises(TypeError, perm, 10, "1")
1887 self.assertRaises(TypeError, perm, 10.0, 1)
1888 self.assertRaises(TypeError, perm, decimal.Decimal(10.0), 1)
1889 self.assertRaises(TypeError, perm, "10", 1)
1891 self.assertRaises(TypeError, perm)
1892 self.assertRaises(TypeError, perm, 10, 1, 3)
1893 self.assertRaises(TypeError, perm)
1896 self.assertRaises(ValueError, perm, -1, 1)
1897 self.assertRaises(ValueError, perm, -2**1000, 1)
1898 self.assertRaises(ValueError, perm, 1, -1)
1899 self.assertRaises(ValueError, perm, 1, -2**1000)
1910 self.assertRaises(OverflowError, perm, n, n)
1951 self.assertRaises(TypeError, comb, 10, 1.0)
1952 self.assertRaises(TypeError, comb, 10, decimal.Decimal(1.0))
1953 self.assertRaises(TypeError, comb, 10, "1")
1954 self.assertRaises(TypeError, comb, 10.0, 1)
1955 self.assertRaises(TypeError, comb, decimal.Decimal(10.0), 1)
1956 self.assertRaises(TypeError, comb, "10", 1)
1958 self.assertRaises(TypeError, comb, 10)
1959 self.assertRaises(TypeError, comb, 10, 1, 3)
1960 self.assertRaises(TypeError, comb)
1963 self.assertRaises(ValueError, comb, -1, 1)
1964 self.assertRaises(ValueError, comb, -2**1000, 1)
1965 self.assertRaises(ValueError, comb, 1, -1)
1966 self.assertRaises(ValueError, comb, 1, -2**1000)
1980 self.assertRaises(OverflowError, comb, n, n//2)
2069 with self.assertRaises(TypeError):
2112 with self.assertRaises(ValueError):
2114 with self.assertRaises(ValueError):