Lines Matching refs:assertRaises
137 self.assertRaises(TypeError, accumulate, range(10), 5, 6) # too many args
138 self.assertRaises(TypeError, accumulate) # too few args
139 self.assertRaises(TypeError, accumulate, x=range(10)) # unexpected kwd arg
140 self.assertRaises(TypeError, list, accumulate([1, []])) # args that don't add
149 with self.assertRaises(TypeError):
157 with self.assertRaises(TypeError):
173 self.assertRaises(TypeError, list,c(2, 3))
180 self.assertRaises(TypeError, list, chain.from_iterable([2, 3]))
191 self.assertRaises(TypeError, list, oper(chain(2, 3)))
196 self.assertRaises(TypeError, chain().__setstate__, ())
197 self.assertRaises(TypeError, chain().__setstate__, [])
198 self.assertRaises(TypeError, chain().__setstate__, 0)
199 self.assertRaises(TypeError, chain().__setstate__, ([],))
200 self.assertRaises(TypeError, chain().__setstate__, (iter([]), []))
209 self.assertRaises(TypeError, combinations, 'abc') # missing r argument
210 self.assertRaises(TypeError, combinations, 'abc', 2, 1) # too many arguments
211 self.assertRaises(TypeError, combinations, None) # pool is not iterable
212 self.assertRaises(ValueError, combinations, 'abc', -2) # r is negative
290 with self.assertRaises((OverflowError, MemoryError)):
301 self.assertRaises(TypeError, cwr, 'abc') # missing r argument
302 self.assertRaises(TypeError, cwr, 'abc', 2, 1) # too many arguments
303 self.assertRaises(TypeError, cwr, None) # pool is not iterable
304 self.assertRaises(ValueError, cwr, 'abc', -2) # r is negative
377 with self.assertRaises((OverflowError, MemoryError)):
388 self.assertRaises(TypeError, permutations) # too few arguments
389 self.assertRaises(TypeError, permutations, 'abc', 2, 1) # too many arguments
390 self.assertRaises(TypeError, permutations, None) # pool is not iterable
391 self.assertRaises(ValueError, permutations, 'abc', -2) # r is negative
393 self.assertRaises(TypeError, permutations, 'abc', 's') # r is not an int or None
452 with self.assertRaises((OverflowError, MemoryError)):
504 self.assertRaises(TypeError, compress, None, range(6)) # 1st arg not iterable
505 self.assertRaises(TypeError, compress, range(6), None) # 2nd arg not iterable
506 self.assertRaises(TypeError, compress, range(6)) # too few args
507 self.assertRaises(TypeError, compress, range(6), None) # too many args
533 self.assertRaises(TypeError, count, 2, 3, 4)
534 self.assertRaises(TypeError, count, 'a')
581 self.assertRaises(TypeError, count, 'a', 'b')
633 self.assertRaises(TypeError, cycle)
634 self.assertRaises(TypeError, cycle, 5)
692 with self.assertRaises(TypeError):
696 with self.assertRaises(TypeError):
702 with self.assertRaises(TypeError):
705 self.assertRaises(TypeError, cycle('').__setstate__, ())
706 self.assertRaises(TypeError, cycle('').__setstate__, ([],))
712 self.assertRaises(TypeError, list, groupby('abc', []))
713 self.assertRaises(TypeError, groupby, None)
714 self.assertRaises(TypeError, groupby, 'abc', lambda x:x, 10)
809 self.assertRaises(ExpectedError, gulp, delayed_raise(0))
811 self.assertRaises(ExpectedError, gulp, delayed_raise(1))
820 self.assertRaises(ExpectedError, gulp, s, func=id)
822 self.assertRaises(ExpectedError, gulp, s)
834 self.assertRaises(ExpectedError, gulp, [None], keyfunc)
836 self.assertRaises(ExpectedError, gulp, [None, None], keyfunc)
843 self.assertRaises(TypeError, filter)
844 self.assertRaises(TypeError, filter, lambda x:x)
845 self.assertRaises(TypeError, filter, lambda x:x, range(6), 7)
846 self.assertRaises(TypeError, filter, isEven, 3)
847 self.assertRaises(TypeError, next, filter(range(6), range(6)))
870 self.assertRaises(TypeError, filterfalse)
871 self.assertRaises(TypeError, filterfalse, lambda x:x)
872 self.assertRaises(TypeError, filterfalse, lambda x:x, range(6), 7)
873 self.assertRaises(TypeError, filterfalse, isEven, 3)
874 self.assertRaises(TypeError, next, filterfalse(range(6), range(6)))
887 self.assertRaises(TypeError, zip, 3)
888 self.assertRaises(TypeError, zip, range(3), 3)
944 self.assertRaises(TypeError, zip_longest, 3)
945 self.assertRaises(TypeError, zip_longest, range(3), 3)
984 with self.assertRaises(TypeError) as cm:
1027 self.assertRaises(RuntimeError, next, it)
1039 with self.assertRaises(TypeError):
1041 with self.assertRaises(TypeError):
1043 with self.assertRaises(TypeError):
1045 with self.assertRaises(TypeError):
1062 self.assertRaises(TypeError, product, range(6), None)
1108 with self.assertRaises((OverflowError, MemoryError)):
1139 self.assertRaises(StopIteration, next, p)
1149 self.assertRaises(TypeError, repeat)
1150 self.assertRaises(TypeError, repeat, None, 3, 4)
1151 self.assertRaises(TypeError, repeat, None, 'a')
1183 self.assertRaises(TypeError, map)
1184 self.assertRaises(TypeError, list, map(None, range(3), range(3)))
1185 self.assertRaises(TypeError, map, operator.neg)
1186 self.assertRaises(TypeError, next, map(10, range(5)))
1187 self.assertRaises(ValueError, next, map(errfunc, [4], [5]))
1188 self.assertRaises(TypeError, next, map(onearg, [4], [5]))
1210 self.assertRaises(TypeError, list, starmap(operator.pow, [None]))
1211 self.assertRaises(TypeError, starmap)
1212 self.assertRaises(TypeError, starmap, operator.pow, [(4,5)], 'extra')
1213 self.assertRaises(TypeError, next, starmap(10, [(4,5)]))
1214 self.assertRaises(ValueError, next, starmap(errfunc, [(4,5)]))
1215 self.assertRaises(TypeError, next, starmap(onearg, [(4,5)]))
1268 self.assertRaises(TypeError, islice, ra)
1269 self.assertRaises(TypeError, islice, ra, 1, 2, 3, 4)
1270 self.assertRaises(ValueError, islice, ra, -5, 10, 1)
1271 self.assertRaises(ValueError, islice, ra, 1, -5, -1)
1272 self.assertRaises(ValueError, islice, ra, 1, 10, -1)
1273 self.assertRaises(ValueError, islice, ra, 1, 10, 0)
1274 self.assertRaises(ValueError, islice, ra, 'a')
1275 self.assertRaises(ValueError, islice, ra, 'a', 1)
1276 self.assertRaises(ValueError, islice, ra, 1, 'a')
1277 self.assertRaises(ValueError, islice, ra, 'a', 1, 1)
1278 self.assertRaises(ValueError, islice, ra, 1, 'a', 1)
1328 self.assertRaises(TypeError, takewhile)
1329 self.assertRaises(TypeError, takewhile, operator.pow)
1330 self.assertRaises(TypeError, takewhile, operator.pow, [(4,5)], 'extra')
1331 self.assertRaises(TypeError, next, takewhile(10, [(4,5)]))
1332 self.assertRaises(ValueError, next, takewhile(errfunc, [(4,5)]))
1335 self.assertRaises(StopIteration, next, t)
1348 self.assertRaises(TypeError, dropwhile)
1349 self.assertRaises(TypeError, dropwhile, operator.pow)
1350 self.assertRaises(TypeError, dropwhile, operator.pow, [(4,5)], 'extra')
1351 self.assertRaises(TypeError, next, dropwhile(10, [(4,5)]))
1352 self.assertRaises(ValueError, next, dropwhile(errfunc, [(4,5)]))
1399 self.assertRaises(TypeError, tee)
1400 self.assertRaises(TypeError, tee, 3)
1401 self.assertRaises(TypeError, tee, [1,2], 'x')
1402 self.assertRaises(TypeError, tee, [1,2], 3, 'x')
1419 self.assertRaises(TypeError, tee, 'abc', 'invalid')
1420 self.assertRaises(ValueError, tee, [], -1)
1435 self.assertRaises(TypeError, tnew)
1436 self.assertRaises(TypeError, tnew, 10)
1446 self.assertRaises(ReferenceError, getattr, p, '__class__')
1557 self.assertRaises(StopIteration, next, zip())
1560 self.assertRaises(StopIteration, next, f([]))
1561 self.assertRaises(StopIteration, next, f(StopNow()))
1563 self.assertRaises(StopIteration, next, islice([], None))
1564 self.assertRaises(StopIteration, next, islice(StopNow(), None))
1567 self.assertRaises(StopIteration, next, p)
1568 self.assertRaises(StopIteration, next, q)
1570 self.assertRaises(StopIteration, next, p)
1571 self.assertRaises(StopIteration, next, q)
1573 self.assertRaises(StopIteration, next, repeat(None, 0))
1576 self.assertRaises(StopIteration, next, f(lambda x:x, []))
1577 self.assertRaises(StopIteration, next, f(lambda x:x, StopNow()))
1967 self.assertRaises(TypeError, accumulate, X(s))
1968 self.assertRaises(TypeError, accumulate, N(s))
1969 self.assertRaises(ZeroDivisionError, list, accumulate(E(s)))
1976 self.assertRaises(TypeError, list, chain(X(s)))
1977 self.assertRaises(TypeError, list, chain(N(s)))
1978 self.assertRaises(ZeroDivisionError, list, chain(E(s)))
1985 self.assertRaises(TypeError, compress, X(s), repeat(1))
1986 self.assertRaises(TypeError, compress, N(s), repeat(1))
1987 self.assertRaises(ZeroDivisionError, list, compress(E(s), repeat(1)))
1991 self.assertRaises(TypeError, product, X(s))
1992 self.assertRaises(TypeError, product, N(s))
1993 self.assertRaises(ZeroDivisionError, product, E(s))
2002 self.assertRaises(TypeError, cycle, X(s))
2003 self.assertRaises(TypeError, cycle, N(s))
2004 self.assertRaises(ZeroDivisionError, list, cycle(E(s)))
2010 self.assertRaises(TypeError, groupby, X(s))
2011 self.assertRaises(TypeError, groupby, N(s))
2012 self.assertRaises(ZeroDivisionError, list, groupby(E(s)))
2019 self.assertRaises(TypeError, filter, isEven, X(s))
2020 self.assertRaises(TypeError, filter, isEven, N(s))
2021 self.assertRaises(ZeroDivisionError, list, filter(isEven, E(s)))
2028 self.assertRaises(TypeError, filterfalse, isEven, X(s))
2029 self.assertRaises(TypeError, filterfalse, isEven, N(s))
2030 self.assertRaises(ZeroDivisionError, list, filterfalse(isEven, E(s)))
2037 self.assertRaises(TypeError, zip, X(s))
2038 self.assertRaises(TypeError, zip, N(s))
2039 self.assertRaises(ZeroDivisionError, list, zip(E(s)))
2046 self.assertRaises(TypeError, zip_longest, X(s))
2047 self.assertRaises(TypeError, zip_longest, N(s))
2048 self.assertRaises(ZeroDivisionError, list, zip_longest(E(s)))
2057 self.assertRaises(TypeError, map, onearg, X(s))
2058 self.assertRaises(TypeError, map, onearg, N(s))
2059 self.assertRaises(ZeroDivisionError, list, map(onearg, E(s)))
2065 self.assertRaises(TypeError, islice, X(s), 10)
2066 self.assertRaises(TypeError, islice, N(s), 10)
2067 self.assertRaises(ZeroDivisionError, list, islice(E(s), 10))
2076 self.assertRaises(TypeError, pairwise, X(s))
2077 self.assertRaises(TypeError, pairwise, N(s))
2078 self.assertRaises(ZeroDivisionError, list, pairwise(E(s)))
2086 self.assertRaises(TypeError, starmap, operator.pow, X(ss))
2087 self.assertRaises(TypeError, starmap, operator.pow, N(ss))
2088 self.assertRaises(ZeroDivisionError, list, starmap(operator.pow, E(ss)))
2098 self.assertRaises(TypeError, takewhile, isEven, X(s))
2099 self.assertRaises(TypeError, takewhile, isEven, N(s))
2100 self.assertRaises(ZeroDivisionError, list, takewhile(isEven, E(s)))
2110 self.assertRaises(TypeError, dropwhile, isOdd, X(s))
2111 self.assertRaises(TypeError, dropwhile, isOdd, N(s))
2112 self.assertRaises(ZeroDivisionError, list, dropwhile(isOdd, E(s)))
2120 self.assertRaises(TypeError, tee, X(s))
2121 self.assertRaises(TypeError, tee, N(s))
2122 self.assertRaises(ZeroDivisionError, list, tee(E(s))[0])
2185 self.assertRaises(AssertionError, list, chain(gen1(), gen2(False)))
2189 self.assertRaises(AssertionError, list, chain(gen1(), gen2(True)))
2193 self.assertRaises(AssertionError, list, cycle(gen1()))
2202 with self.assertRaises(StopIteration):