Home
last modified time | relevance | path

Searched refs:assertRaises (Results 1 – 25 of 531) sorted by relevance

12345678910>>...22

/third_party/python/Lib/test/
Dtest_getargs2.py159 self.assertRaises(TypeError, getargs_b, 3.14)
162 self.assertRaises(TypeError, getargs_b, BadIndex())
166 self.assertRaises(TypeError, getargs_b, Int())
168 self.assertRaises(TypeError, getargs_b, BadInt())
169 self.assertRaises(TypeError, getargs_b, BadInt2())
172 self.assertRaises(OverflowError, getargs_b, -1)
175 self.assertRaises(OverflowError, getargs_b, UCHAR_MAX + 1)
178 self.assertRaises(OverflowError, getargs_b, VERY_LARGE)
183 self.assertRaises(TypeError, getargs_B, 3.14)
186 self.assertRaises(TypeError, getargs_B, BadIndex())
[all …]
Dtest_operator.py50 self.assertRaises(TypeError, operator.lt)
51 self.assertRaises(TypeError, operator.lt, 1j, 2j)
61 self.assertRaises(TypeError, operator.le)
62 self.assertRaises(TypeError, operator.le, 1j, 2j)
75 self.assertRaises(TypeError, operator.eq)
76 self.assertRaises(SyntaxError, operator.eq, C(), C())
89 self.assertRaises(TypeError, operator.ne)
90 self.assertRaises(SyntaxError, operator.ne, C(), C())
100 self.assertRaises(TypeError, operator.ge)
101 self.assertRaises(TypeError, operator.ge, 1j, 2j)
[all …]
Dtest_string_literals.py93 self.assertRaises(SyntaxError, eval, r""" '\x' """)
94 self.assertRaises(SyntaxError, eval, r""" '\x0' """)
95 self.assertRaises(SyntaxError, eval, r""" '\u' """)
96 self.assertRaises(SyntaxError, eval, r""" '\u0' """)
97 self.assertRaises(SyntaxError, eval, r""" '\u00' """)
98 self.assertRaises(SyntaxError, eval, r""" '\u000' """)
99 self.assertRaises(SyntaxError, eval, r""" '\U' """)
100 self.assertRaises(SyntaxError, eval, r""" '\U0' """)
101 self.assertRaises(SyntaxError, eval, r""" '\U00' """)
102 self.assertRaises(SyntaxError, eval, r""" '\U000' """)
[all …]
Dtest_tcl.py47 self.assertRaises(TypeError, _tkinter._flatten, True)
49 self.assertRaises(TypeError, _tkinter._flatten, {})
52 self.assertRaises(TypeError, _tkinter._flatten, 'string')
53 self.assertRaises(TypeError, _tkinter._flatten, {'set'})
77 self.assertRaises(TclError,tcl.eval,'set a')
81 self.assertRaises(TclError,tcl.eval,'this is wrong')
90 self.assertRaises(TclError,tcl.call,'set','a')
94 self.assertRaises(TclError,tcl.call,'this','is','wrong')
118 self.assertRaises(TclError,tcl.getvar,'a')
122 self.assertRaises(TclError,tcl.getvar,'a(1)')
[all …]
Dtest_codeccallbacks.py190 self.assertRaises(UnicodeDecodeError, sin.decode,
204 self.assertRaises(UnicodeError, codecs.charmap_encode, sin, "strict", charmap)
212 self.assertRaises(TypeError, codecs.charmap_encode, sin, "replace", charmap)
293 self.assertRaises(TypeError, exctype, *args[:-1])
295 self.assertRaises(TypeError, exctype, *(args + ["too much"]))
309 self.assertRaises(TypeError, exctype, *callargs)
388 self.assertRaises(
394 self.assertRaises(
401 self.assertRaises(
406 self.assertRaises(
[all …]
Dtest_builtin.py162 self.assertRaises(ImportError, __import__, 'spamspam')
163 self.assertRaises(TypeError, __import__, 1, 2, 3, 4)
164 self.assertRaises(ValueError, __import__, '')
165 self.assertRaises(TypeError, __import__, 'sys', name='sys')
168 self.assertRaises(ImportError, __import__, '',
172 self.assertRaises(ModuleNotFoundError, __import__, 'string\x00')
185 self.assertRaises(TypeError, abs, 'a')
190 self.assertRaises(TypeError, abs)
191 self.assertRaises(TypeError, abs, None)
200 self.assertRaises(RuntimeError, all, [2, TestFailingBool(), 6])
[all …]
Dtest_lzma.py27 self.assertRaises(TypeError, LZMACompressor, [])
28 self.assertRaises(TypeError, LZMACompressor, format=3.45)
29 self.assertRaises(TypeError, LZMACompressor, check="")
30 self.assertRaises(TypeError, LZMACompressor, preset="asdf")
31 self.assertRaises(TypeError, LZMACompressor, filters=3)
33 self.assertRaises(ValueError, LZMACompressor, format=lzma.FORMAT_AUTO)
35 with self.assertRaises(ValueError):
38 self.assertRaises(TypeError, LZMADecompressor, ())
39 self.assertRaises(TypeError, LZMADecompressor, memlimit=b"qw")
40 with self.assertRaises(TypeError):
[all …]
Dtest_complex.py120 with self.assertRaises(ZeroDivisionError):
124 with self.assertRaises(TypeError):
126 with self.assertRaises(TypeError):
128 with self.assertRaises(TypeError):
130 with self.assertRaises(TypeError):
132 with self.assertRaises(TypeError):
137 with self.assertRaises(TypeError):
157 self.assertRaises(TypeError, operator.lt, 1+1j, 2+2j)
158 self.assertRaises(TypeError, operator.le, 1+1j, 2+2j)
159 self.assertRaises(TypeError, operator.gt, 1+1j, 2+2j)
[all …]
Dtest_float.py40 self.assertRaises(ValueError, float, " 0x3.1 ")
41 self.assertRaises(ValueError, float, " -0x3.p-1 ")
42 self.assertRaises(ValueError, float, " +0x3.p-1 ")
43 self.assertRaises(ValueError, float, "++3.14")
44 self.assertRaises(ValueError, float, "+-3.14")
45 self.assertRaises(ValueError, float, "-+3.14")
46 self.assertRaises(ValueError, float, "--3.14")
47 self.assertRaises(ValueError, float, ".nan")
48 self.assertRaises(ValueError, float, "+.inf")
49 self.assertRaises(ValueError, float, ".")
[all …]
Dtest_math.py259 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)
[all …]
Dtest_unicode.py85 self.assertRaises(SyntaxError, eval, '\'\\Ufffffffe\'')
86 self.assertRaises(SyntaxError, eval, '\'\\Uffffffff\'')
87 self.assertRaises(SyntaxError, eval, '\'\\U%08x\'' % 0x110000)
131 self.assertRaises(TypeError, ascii, WrongRepr())
173 self.assertRaises(TypeError, repr, WrongRepr())
181 self.assertRaises(StopIteration, next, it)
224 self.assertRaises(TypeError, 'hello'.find)
225 self.assertRaises(TypeError, 'hello'.find, 42)
274 self.assertRaises(ValueError, 'abcdefghiabc'.index, 'hib')
275 self.assertRaises(ValueError, 'abcdefghiab'.index, 'abc', 1)
[all …]
Dtest_range.py77 self.assertRaises(TypeError, range)
78 self.assertRaises(TypeError, range, 1, 2, 3, 4)
79 self.assertRaises(ValueError, range, 1, 2, 0)
81 self.assertRaises(TypeError, range, 0.0, 2, 1)
82 self.assertRaises(TypeError, range, 1, 2.0, 1)
83 self.assertRaises(TypeError, range, 1, 2, 1.0)
84 self.assertRaises(TypeError, range, 1e100, 1e101, 1e101)
86 self.assertRaises(TypeError, range, 0, "spam")
87 self.assertRaises(TypeError, range, 0, 42, "spam")
180 self.assertRaises(OverflowError, len, x)
[all …]
Dtest_int.py85 self.assertRaises(TypeError, int, 1, 12)
91 self.assertRaises(ValueError, int, "0x", 16)
92 self.assertRaises(ValueError, int, "0x", 0)
94 self.assertRaises(ValueError, int, "0o", 8)
95 self.assertRaises(ValueError, int, "0o", 0)
97 self.assertRaises(ValueError, int, "0b", 2)
98 self.assertRaises(ValueError, int, "0b", 0)
166 self.assertRaises(ValueError, int, '0b2', 2)
167 self.assertRaises(ValueError, int, '0b02', 2)
168 self.assertRaises(ValueError, int, '0B2', 2)
[all …]
Dtest_aifc.py158 with self.assertRaises(aifc.Error):
167 with self.assertRaises(RuntimeError):
218 self.assertRaises(aifc.Error, f.getmark, 3)
246 self.assertRaises(EOFError, aifc._read_ulong, f)
247 self.assertRaises(EOFError, aifc._read_long, f)
248 self.assertRaises(EOFError, aifc._read_ushort, f)
249 self.assertRaises(EOFError, aifc._read_short, f)
253 with self.assertRaises(ValueError):
257 with self.assertRaises(aifc.Error):
263 self.assertRaises(aifc.Error, aifc.open, b1)
[all …]
Dtest_decimal.py517 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)) )
[all …]
Dtest_epoll.py74 self.assertRaises(ValueError, ep.fileno)
82 self.assertRaises(TypeError, select.epoll, 1, 2, 3)
83 self.assertRaises(TypeError, select.epoll, 'foo')
84 self.assertRaises(TypeError, select.epoll, None)
85 self.assertRaises(TypeError, select.epoll, ())
86 self.assertRaises(TypeError, select.epoll, ['foo'])
87 self.assertRaises(TypeError, select.epoll, {})
89 self.assertRaises(ValueError, select.epoll, 0)
90 self.assertRaises(ValueError, select.epoll, -2)
91 self.assertRaises(ValueError, select.epoll, sizehint=-2)
[all …]
Dtest_itertools.py137 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__, ())
[all …]
Dtest_devpoll.py80 self.assertRaises(OverflowError, pollster.poll, -2)
81 self.assertRaises(OverflowError, pollster.poll, -1 << 31)
82 self.assertRaises(OverflowError, pollster.poll, -1 << 64)
87 self.assertRaises(OverflowError, pollster.poll, 1 << 31)
88 self.assertRaises(OverflowError, pollster.poll, 1 << 63)
89 self.assertRaises(OverflowError, pollster.poll, 1 << 64)
104 self.assertRaises(ValueError, devpoll.fileno)
110 self.assertRaises(ValueError, devpoll.modify, fd, select.POLLIN)
111 self.assertRaises(ValueError, devpoll.poll)
112 self.assertRaises(ValueError, devpoll.register, fd, select.POLLIN)
[all …]
Dlist_tests.py67 self.assertRaises(RecursionError, repr, a)
71 self.assertRaises(ValueError, a.__setitem__, slice(0, 10, 0), [1,2,3])
72 self.assertRaises(TypeError, a.__setitem__, slice(0, 10), 1)
73 self.assertRaises(ValueError, a.__setitem__, slice(0, 10, 2), [1,2])
74 self.assertRaises(TypeError, a.__getitem__, 'x', 1)
84 self.assertRaises(StopIteration, next, r)
88 self.assertRaises(TypeError, len, reversed([1,2,3]))
99 self.assertRaises(IndexError, a.__setitem__, -3, 200)
100 self.assertRaises(IndexError, a.__setitem__, 2, 200)
103 self.assertRaises(IndexError, a.__setitem__, 0, 200)
[all …]
Dtest_memoryio.py53 self.assertRaises(TypeError, bytesIo.seek, 0.0)
70 self.assertRaises(self.UnsupportedOperation, buf.detach)
94 self.assertRaises(TypeError, memio.write, None)
96 self.assertRaises(ValueError, memio.write, self.buftype(""))
107 self.assertRaises(TypeError, memio.writelines, [buf] + [1])
109 self.assertRaises(TypeError, memio.writelines, None)
111 self.assertRaises(ValueError, memio.writelines, [])
119 self.assertRaises(KeyboardInterrupt, memio.writelines, error_gen())
125 self.assertRaises(ValueError, memio.truncate, -1)
126 self.assertRaises(ValueError, memio.truncate, IntLike(-1))
[all …]
/third_party/python/Lib/unittest/test/
Dtest_case.py94 with test.assertRaises(test.failureException):
97 with self.assertRaises(AttributeError):
641 self.assertRaises(self.failureException, self.assertIs, thing, object())
646 self.assertRaises(self.failureException, self.assertIsNot, thing, thing)
651 self.assertRaises(self.failureException, self.assertIsInstance,
657 self.assertRaises(self.failureException, self.assertNotIsInstance,
671 self.assertRaises(self.failureException, self.assertIn, 'x', 'abc')
672 self.assertRaises(self.failureException, self.assertIn, 4, [1, 2, 3])
673 self.assertRaises(self.failureException, self.assertIn, 'elephant',
676 self.assertRaises(self.failureException, self.assertNotIn, 'c', 'abc')
[all …]
/third_party/python/Lib/test/test_asyncio/
Dtest_transports.py42 self.assertRaises(NotImplementedError,
44 self.assertRaises(NotImplementedError, transport.get_write_buffer_size)
45 self.assertRaises(NotImplementedError, transport.write, 'data')
46 self.assertRaises(NotImplementedError, transport.write_eof)
47 self.assertRaises(NotImplementedError, transport.can_write_eof)
48 self.assertRaises(NotImplementedError, transport.pause_reading)
49 self.assertRaises(NotImplementedError, transport.resume_reading)
50 self.assertRaises(NotImplementedError, transport.is_reading)
51 self.assertRaises(NotImplementedError, transport.close)
52 self.assertRaises(NotImplementedError, transport.abort)
[all …]
/third_party/python/Lib/unittest/test/testmock/
Dtestsealable.py25 with self.assertRaises(AttributeError):
27 with self.assertRaises(AttributeError):
34 with self.assertRaises(AttributeError):
50 with self.assertRaises(AttributeError):
71 with self.assertRaises(AttributeError):
87 with self.assertRaises(AttributeError):
89 with self.assertRaises(AttributeError):
101 with self.assertRaises(AttributeError):
103 with self.assertRaises(AttributeError):
127 with self.assertRaises(AttributeError):
[all …]
/third_party/python/Lib/ctypes/test/
Dtest_frombuffer.py26 self.assertRaises(BufferError, a.append, 100)
27 self.assertRaises(BufferError, a.pop)
72 with self.assertRaises(ValueError):
74 with self.assertRaises(ValueError):
76 with self.assertRaises(ValueError):
108 with self.assertRaises(TypeError):
116 with self.assertRaises(ValueError):
118 with self.assertRaises(ValueError):
120 with self.assertRaises(ValueError):
126 self.assertRaises(TypeError, Array.from_buffer, bytearray(10))
[all …]
/third_party/python/Lib/idlelib/idle_test/
Dtest_run.py132 self.assertRaises(OSError, f.fileno)
133 self.assertRaises(OSError, f.tell)
134 self.assertRaises(OSError, f.seek, 0)
135 self.assertRaises(OSError, f.write, 'x')
136 self.assertRaises(OSError, f.writelines, ['x'])
154 self.assertRaises(TypeError, f.read, 1.5)
155 self.assertRaises(TypeError, f.read, '1')
156 self.assertRaises(TypeError, f.read, 1, 1)
179 self.assertRaises(TypeError, f.readlines, 1.5)
180 self.assertRaises(TypeError, f.readlines, '1')
[all …]

12345678910>>...22