Lines Matching defs:checkraises

84     def checkraises(self, exc, obj, methodname, *args, expected_msg=None):
129 self.checkraises(TypeError, 'hello', 'count')
134 self.checkraises(TypeError, 'hello', 'count', 42)
179 self.checkraises(TypeError, 'hello', 'find')
184 self.checkraises(TypeError, 'hello', 'find', 42)
237 self.checkraises(TypeError, 'hello', 'rfind')
242 self.checkraises(TypeError, 'hello', 'rfind', 42)
279 self.checkraises(ValueError, 'abcdefghiabc', 'index', 'hib')
280 self.checkraises(ValueError, 'abcdefghiab', 'index', 'abc', 1)
281 self.checkraises(ValueError, 'abcdefghi', 'index', 'ghi', 8)
282 self.checkraises(ValueError, 'abcdefghi', 'index', 'ghi', -1)
287 self.checkraises(ValueError, 'rrarrrrrrrrra', 'index', 'a', 4, 6)
291 self.checkraises(TypeError, 'hello', 'index')
294 self.checkraises(ValueError, 'hello', 'index', 42)
296 self.checkraises(TypeError, 'hello', 'index', 42)
304 self.checkraises(ValueError, 'abcdefghiabc', 'rindex', 'hib')
305 self.checkraises(ValueError, 'defghiabc', 'rindex', 'def', 1)
306 self.checkraises(ValueError, 'defghiabc', 'rindex', 'abc', 0, -1)
307 self.checkraises(ValueError, 'abcdefghi', 'rindex', 'ghi', 0, 8)
308 self.checkraises(ValueError, 'abcdefghi', 'rindex', 'ghi', 0, -1)
313 self.checkraises(ValueError, 'rrarrrrrrrrra', 'rindex', 'a', 4, 6)
317 self.checkraises(TypeError, 'hello', 'rindex')
320 self.checkraises(ValueError, 'hello', 'rindex', 42)
322 self.checkraises(TypeError, 'hello', 'rindex', 42)
365 self.checkraises(TypeError, 'hello', 'lower', 42)
370 self.checkraises(TypeError, 'hello', 'upper', 42)
395 self.checkraises(TypeError, 'hello', 'expandtabs', 42, 42)
398 self.checkraises(OverflowError,
465 self.checkraises(TypeError, 'hello', 'split', 42, 42, 42)
468 self.checkraises(ValueError, 'hello', 'split', '')
469 self.checkraises(ValueError, 'hello', 'split', '', 0)
543 self.checkraises(TypeError, 'hello', 'rsplit', 42, 42, 42)
546 self.checkraises(ValueError, 'hello', 'rsplit', '')
547 self.checkraises(ValueError, 'hello', 'rsplit', '', 0)
721 self.checkraises(TypeError, 'hello', 'replace')
722 self.checkraises(TypeError, 'hello', 'replace', 42)
723 self.checkraises(TypeError, 'hello', 'replace', 42, 'h')
724 self.checkraises(TypeError, 'hello', 'replace', 'h', 42)
731 self.checkraises(OverflowError, A2_16, "replace", "", A2_16)
732 self.checkraises(OverflowError, A2_16, "replace", "A", A2_16)
733 self.checkraises(OverflowError, A2_16, "replace", "AA", A2_16+A2_16)
747 self.checkraises(TypeError, 'hello', 'removeprefix')
748 self.checkraises(TypeError, 'hello', 'removeprefix', 42)
749 self.checkraises(TypeError, 'hello', 'removeprefix', 42, 'h')
750 self.checkraises(TypeError, 'hello', 'removeprefix', 'h', 42)
751 self.checkraises(TypeError, 'hello', 'removeprefix', ("he", "l"))
765 self.checkraises(TypeError, 'hello', 'removesuffix')
766 self.checkraises(TypeError, 'hello', 'removesuffix', 42)
767 self.checkraises(TypeError, 'hello', 'removesuffix', 42, 'h')
768 self.checkraises(TypeError, 'hello', 'removesuffix', 'h', 42)
769 self.checkraises(TypeError, 'hello', 'removesuffix', ("lo", "l"))
778 self.checkraises(TypeError, 'hello', 'capitalize', 42)
884 self.checkraises(TypeError, 'hello', 'strip', 42, 42)
885 self.checkraises(TypeError, 'hello', 'lstrip', 42, 42)
886 self.checkraises(TypeError, 'hello', 'rstrip', 42, 42)
894 self.checkraises(TypeError, 'abc', 'ljust')
902 self.checkraises(TypeError, 'abc', 'rjust')
910 self.checkraises(TypeError, 'abc', 'center')
915 self.checkraises(TypeError, 'hello', 'swapcase', 42)
931 self.checkraises(TypeError, '123', 'zfill')
941 self.checkraises(TypeError, 'abc', 'islower', 42)
951 self.checkraises(TypeError, 'abc', 'isupper', 42)
965 self.checkraises(TypeError, 'abc', 'istitle', 42)
976 self.checkraises(TypeError, 'abc', 'isspace', 42)
986 self.checkraises(TypeError, 'abc', 'isalpha', 42)
997 self.checkraises(TypeError, 'abc', 'isalnum', 42)
1021 self.checkraises(TypeError, 'abc', 'isdigit', 42)
1030 self.checkraises(TypeError, 'hello', 'title', 42)
1048 self.checkraises(TypeError, 'abc', 'splitlines', 42, 42)
1117 self.checkraises(TypeError, 'hello', 'startswith')
1118 self.checkraises(TypeError, 'hello', 'startswith', 42)
1133 self.checkraises(TypeError, 'hello', 'startswith', (42,))
1169 self.checkraises(TypeError, 'hello', 'endswith')
1170 self.checkraises(TypeError, 'hello', 'endswith', 42)
1185 self.checkraises(TypeError, 'hello', 'endswith', (42,))
1207 self.checkraises(TypeError, 'abc', '__getitem__', 'def')
1211 self.checkraises(TypeError, 'abc', '__getitem__', idx_type, expected_msg=expected_msg)
1224 self.checkraises(TypeError, 'abc', '__getitem__', 'def')
1243 self.checkraises(TypeError, 'abc', '__mul__')
1244 self.checkraises(TypeError, 'abc', '__mul__', '')
1247 #self.checkraises(OverflowError, 10000*'abc', '__mul__', 2000000000)
1271 self.checkraises(TypeError, ' ', 'join')
1272 self.checkraises(TypeError, ' ', 'join', None)
1273 self.checkraises(TypeError, ' ', 'join', 7)
1274 self.checkraises(TypeError, ' ', 'join', [1, 2, bytes()])
1297 self.checkraises((ValueError, OverflowError), '%c', '__mod__', ordinal)
1308 self.checkraises(TypeError, 'abc', '__mod__')
1309 self.checkraises(TypeError, '%(foo)s', '__mod__', 42)
1310 self.checkraises(TypeError, '%s%s', '__mod__', (42,))
1311 self.checkraises(TypeError, '%c', '__mod__', (None,))
1312 self.checkraises(ValueError, '%(foo', '__mod__', {})
1313 self.checkraises(TypeError, '%(foo)s %(bar)s', '__mod__', ('foo', 42))
1314 self.checkraises(TypeError, '%d', '__mod__', "42") # not numeric
1315 self.checkraises(TypeError, '%d', '__mod__', (42+0j)) # no int conversion provided
1323 self.checkraises(TypeError, '%*s', '__mod__', ('foo', 'bar'))
1324 self.checkraises(TypeError, '%10.*f', '__mod__', ('foo', 42.))
1325 self.checkraises(ValueError, '%10', '__mod__', (42,))
1328 self.checkraises(ValueError, '%%%df' % (2**64), '__mod__', (3.2))
1329 self.checkraises(ValueError, '%%.%df' % (2**64), '__mod__', (3.2))
1330 self.checkraises(OverflowError, '%*s', '__mod__',
1332 self.checkraises(OverflowError, '%.*f', '__mod__',
1336 self.checkraises(TypeError, 'abc', '__mod__', X())
1342 self.checkraises(OverflowError, '%*s', '__mod__',
1344 self.checkraises(OverflowError, '%.*f', '__mod__',
1347 self.checkraises(OverflowError, '%*s', '__mod__',
1349 self.checkraises(OverflowError, '%.*f', '__mod__',
1392 self.checkraises(ValueError, S, 'partition', '')
1393 self.checkraises(TypeError, S, 'partition', None)
1407 self.checkraises(ValueError, S, 'rpartition', '')
1408 self.checkraises(TypeError, S, 'rpartition', None)