Lines Matching refs:test_exc
74 def test_exc(formatstr, args, exception, excmsg):
93 test_exc(formatstr, args, exception, excmsg)
94 test_exc(formatstr.encode('ascii'), args, exception, excmsg)
295 test_exc('abc %b', 1, ValueError,
297 #test_exc(unicode('abc %\u3000','raw-unicode-escape'), 1, ValueError,
299 test_exc('%g', '1', TypeError, "must be real number, not str")
300 test_exc('no format', '1', TypeError,
302 test_exc('%c', -1, OverflowError, "%c arg not in range(0x110000)")
303 test_exc('%c', sys.maxunicode+1, OverflowError,
305 #test_exc('%c', 2**128, OverflowError, "%c arg not in range(0x110000)")
306 test_exc('%c', 3.14, TypeError, "%c requires int or char")
307 test_exc('%c', 'ab', TypeError, "%c requires int or char")
308 test_exc('%c', b'x', TypeError, "%c requires int or char")
357 test_exc(b'%g', '1', TypeError, "float argument required, not str")
358 test_exc(b'%g', b'1', TypeError, "float argument required, not bytes")
359 test_exc(b'no format', 7, TypeError,
361 test_exc(b'no format', b'1', TypeError,
363 test_exc(b'no format', bytearray(b'1'), TypeError,
365 test_exc(b"%c", -1, OverflowError,
367 test_exc(b"%c", 256, OverflowError,
369 test_exc(b"%c", 2**128, OverflowError,
371 test_exc(b"%c", b"Za", TypeError,
373 test_exc(b"%c", "Y", TypeError,
375 test_exc(b"%c", 3.14, TypeError,
377 test_exc(b"%b", "Xc", TypeError,
380 test_exc(b"%s", "Wd", TypeError,