Home
last modified time | relevance | path

Searched refs:TypeError (Results 1 – 25 of 1778) sorted by relevance

12345678910>>...72

/external/python/cpython3/Lib/test/
Dtest_call.py37 self.assertRaises(TypeError, {}.__contains__)
43 self.assertRaises(TypeError, {}.__contains__, 0, 1)
48 except TypeError:
57 except TypeError:
63 self.assertRaises(TypeError, {}.__contains__, x=2)
66 self.assertRaises(TypeError, {}.__contains__, x=2, y=2)
72 self.assertRaises(TypeError, {}.keys, 0)
75 self.assertRaises(TypeError, {}.keys, 0, 1)
83 except TypeError:
91 except TypeError:
[all …]
Dtest_getargs2.py136 self.assertRaises(TypeError, getargs_b, 3.14)
139 self.assertRaises(TypeError, getargs_b, BadInt())
155 self.assertRaises(TypeError, getargs_B, 3.14)
158 self.assertRaises(TypeError, getargs_B, BadInt())
174 self.assertRaises(TypeError, getargs_H, 3.14)
177 self.assertRaises(TypeError, getargs_H, BadInt())
194 self.assertRaises(TypeError, getargs_I, 3.14)
197 self.assertRaises(TypeError, getargs_I, BadInt())
215 self.assertRaises(TypeError, getargs_k, 3.14)
216 self.assertRaises(TypeError, getargs_k, Int())
[all …]
Dtest_operator.py42 self.assertRaises(TypeError, operator.lt)
43 self.assertRaises(TypeError, operator.lt, 1j, 2j)
53 self.assertRaises(TypeError, operator.le)
54 self.assertRaises(TypeError, operator.le, 1j, 2j)
67 self.assertRaises(TypeError, operator.eq)
81 self.assertRaises(TypeError, operator.ne)
92 self.assertRaises(TypeError, operator.ge)
93 self.assertRaises(TypeError, operator.ge, 1j, 2j)
103 self.assertRaises(TypeError, operator.gt)
104 self.assertRaises(TypeError, operator.gt, 1j, 2j)
[all …]
Dtest_codeccallbacks.py89 raise TypeError("don't know how to handle %r" % exc)
120 raise TypeError("don't know how to handle %r" % exc)
175 raise TypeError("don't know how to handle %r" % exc)
212 self.assertRaises(TypeError, codecs.charmap_encode, sin, "replace", charmap)
225 raise TypeError("don't know how to handle %r" % exc)
258 raise TypeError("don't know how to handle %r" % exc)
265 raise TypeError("don't know how to handle %r" % exc)
329 self.assertRaises(TypeError, exctype, *args[:-1])
331 self.assertRaises(TypeError, exctype, *(args + ["too much"]))
345 self.assertRaises(TypeError, exctype, *callargs)
[all …]
Dtest_raise.py50 raise TypeError("foo")
57 self.assertRaises(TypeError, reraise)
62 raise TypeError("foo")
75 raise TypeError("foo")
78 self.assertRaises(TypeError, reraise)
83 raise TypeError("foo")
87 self.assertIsInstance(e.__context__, TypeError)
93 raise TypeError("foo")
98 self.assertRaises(TypeError, reraise)
103 raise TypeError("foo")
[all …]
Dstring_tests.py74 except TypeError:
125 self.checkraises(TypeError, 'hello', 'count')
130 self.checkraises(TypeError, 'hello', 'count', 42)
175 self.checkraises(TypeError, 'hello', 'find')
180 self.checkraises(TypeError, 'hello', 'find', 42)
233 self.checkraises(TypeError, 'hello', 'rfind')
238 self.checkraises(TypeError, 'hello', 'rfind', 42)
287 self.checkraises(TypeError, 'hello', 'index')
292 self.checkraises(TypeError, 'hello', 'index', 42)
313 self.checkraises(TypeError, 'hello', 'rindex')
[all …]
Dtest_builtin.py154 self.assertRaises(TypeError, __import__, 1, 2, 3, 4)
156 self.assertRaises(TypeError, __import__, 'sys', name='sys')
171 self.assertRaises(TypeError, abs, 'a')
176 self.assertRaises(TypeError, abs)
177 self.assertRaises(TypeError, abs, None)
188 self.assertRaises(TypeError, all, 10) # Non-iterable
189 self.assertRaises(TypeError, all) # No args
190 self.assertRaises(TypeError, all, [2, 4, 6], []) # Too many args
203 self.assertRaises(TypeError, any, 10) # Non-iterable
204 self.assertRaises(TypeError, any) # No args
[all …]
Dtest_typing.py71 with self.assertRaises(TypeError):
75 with self.assertRaises(TypeError):
77 with self.assertRaises(TypeError):
84 with self.assertRaises(TypeError):
86 with self.assertRaises(TypeError):
90 with self.assertRaises(TypeError):
93 with self.assertRaises(TypeError):
98 with self.assertRaises(TypeError):
100 with self.assertRaises(TypeError):
113 with self.assertRaises(TypeError):
[all …]
Dtest_unicodedata.py113 self.assertRaises(TypeError, self.db.digit)
114 self.assertRaises(TypeError, self.db.digit, 'xx')
126 self.assertRaises(TypeError, self.db.numeric)
127 self.assertRaises(TypeError, self.db.numeric, 'xx')
138 self.assertRaises(TypeError, self.db.decimal)
139 self.assertRaises(TypeError, self.db.decimal, 'xx')
149 self.assertRaises(TypeError, self.db.category)
150 self.assertRaises(TypeError, self.db.category, 'xx')
158 self.assertRaises(TypeError, self.db.bidirectional)
159 self.assertRaises(TypeError, self.db.bidirectional, 'xx')
[all …]
/external/python/cpython2/Lib/test/
Dtest_call.py12 self.assertRaises(TypeError, {}.has_key)
19 self.assertRaises(TypeError, {}.has_key, 0, 1)
24 except TypeError:
35 except TypeError:
41 self.assertRaises(TypeError, {}.has_key, x=2)
44 self.assertRaises(TypeError, {}.has_key, x=2)
47 self.assertRaises(TypeError, {}.has_key, x=2, y=2)
53 self.assertRaises(TypeError, {}.keys, 0)
56 self.assertRaises(TypeError, {}.keys, 0, 1)
64 except TypeError:
[all …]
Dtest_operator.py37 self.assertRaises(TypeError, operator.lt)
38 self.assertRaises(TypeError, operator.lt, 1j, 2j)
47 self.assertRaises(TypeError, operator.le)
48 self.assertRaises(TypeError, operator.le, 1j, 2j)
61 self.assertRaises(TypeError, operator.eq)
74 self.assertRaises(TypeError, operator.ne)
84 self.assertRaises(TypeError, operator.ge)
85 self.assertRaises(TypeError, operator.ge, 1j, 2j)
94 self.assertRaises(TypeError, operator.gt)
95 self.assertRaises(TypeError, operator.gt, 1j, 2j)
[all …]
Dtest_getargs2.py133 self.assertRaises(TypeError, getargs_b, 3.14)
149 self.assertRaises(TypeError, getargs_B, 3.14)
166 self.assertRaises(TypeError, getargs_H, 3.14)
183 self.assertRaises(TypeError, getargs_I, 3.14)
201 self.assertRaises(TypeError, getargs_k, 3.14)
202 self.assertRaises(TypeError, getargs_k, Long())
203 self.assertRaises(TypeError, getargs_k, Int())
219 self.assertRaises(TypeError, getargs_h, 3.14)
235 self.assertRaises(TypeError, getargs_i, 3.14)
251 self.assertRaises(TypeError, getargs_l, 3.14)
[all …]
Dtest_builtin.py73 self.assertRaises(TypeError, __import__, 1, 2, 3, 4)
75 self.assertRaises(TypeError, __import__, 'sys', name='sys')
92 self.assertRaises(TypeError, abs, 'a')
97 self.assertRaises(TypeError, abs)
98 self.assertRaises(TypeError, abs, None)
109 self.assertRaises(TypeError, all, 10) # Non-iterable
110 self.assertRaises(TypeError, all) # No args
111 self.assertRaises(TypeError, all, [2, 4, 6], []) # Too many args
124 self.assertRaises(TypeError, any, 10) # Non-iterable
125 self.assertRaises(TypeError, any) # No args
[all …]
Dtest_codeccallbacks.py104 raise TypeError("don't know how to handle %r" % exc)
135 raise TypeError("don't know how to handle %r" % exc)
182 raise TypeError("don't know how to handle %r" % exc)
219 self.assertRaises(TypeError, codecs.charmap_encode, sin, "replace", charmap)
222 self.assertRaises(TypeError, codecs.charmap_encode, sin, "replace", charmap)
233 raise TypeError("don't know how to handle %r" % exc)
257 raise TypeError("don't know how to handle %r" % exc)
265 raise TypeError("don't know how to handle %r" % exc)
329 self.assertRaises(TypeError, exctype, *args[:-1])
331 self.assertRaises(TypeError, exctype, *(args + ["too much"]))
[all …]
Dstring_tests.py100 self.checkraises(TypeError, 'hello', 'capitalize', 42)
132 self.checkraises(TypeError, 'hello', 'count')
133 self.checkraises(TypeError, 'hello', 'count', 42)
178 self.checkraises(TypeError, 'hello', 'find')
179 self.checkraises(TypeError, 'hello', 'find', 42)
233 self.checkraises(TypeError, 'hello', 'rfind')
234 self.checkraises(TypeError, 'hello', 'rfind', 42)
281 self.checkraises(TypeError, 'hello', 'index')
282 self.checkraises(TypeError, 'hello', 'index', 42)
303 self.checkraises(TypeError, 'hello', 'rindex')
[all …]
/external/python/cpython3/Lib/ctypes/test/
Dtest_parameters.py62 self.assertRaises(TypeError, c_char_p.from_param, "123\377")
63 self.assertRaises(TypeError, c_char_p.from_param, 42)
76 self.assertRaises(TypeError, c_wchar_p.from_param, 42)
77 self.assertRaises(TypeError, c_wchar_p.from_param, b"123\377")
95 self.assertRaises(TypeError, LPINT.from_param, pointer(c_long(42)))
96 self.assertRaises(TypeError, LPINT.from_param, pointer(c_uint(42)))
97 self.assertRaises(TypeError, LPINT.from_param, pointer(c_short(42)))
107 self.assertRaises(TypeError, LPINT.from_param, byref(c_short(22)))
109 self.assertRaises(TypeError, LPINT.from_param, byref(c_long(22)))
110 self.assertRaises(TypeError, LPINT.from_param, byref(c_uint(22)))
[all …]
Dtest_bytes.py9 self.assertRaises(TypeError, c_char, "x")
11 with self.assertRaises(TypeError):
14 self.assertRaises(TypeError, c_char.from_param, "x")
17 self.assertRaises(TypeError, c_char * 3, "a", "b", "c")
21 self.assertRaises(TypeError, c_wchar, b"x")
23 with self.assertRaises(TypeError):
26 self.assertRaises(TypeError, c_wchar.from_param, b"x")
28 self.assertRaises(TypeError, c_wchar * 3, b"a", b"b", b"c")
32 self.assertRaises(TypeError, c_char_p, "foo bar")
36 self.assertRaises(TypeError, c_wchar_p, b"foo bar")
[all …]
Dtest_frombuffer.py41 with self.assertRaisesRegex(TypeError, "not writable"):
43 with self.assertRaisesRegex(TypeError, "not writable"):
45 with self.assertRaisesRegex(TypeError, "not C contiguous"):
48 with self.assertRaisesRegex(TypeError, msg):
59 with self.assertRaisesRegex(TypeError, "not C contiguous"):
64 with self.assertRaisesRegex(TypeError, "not C contiguous"):
108 with self.assertRaises(TypeError):
126 self.assertRaises(TypeError, Array.from_buffer, bytearray(10))
127 self.assertRaises(TypeError, Structure.from_buffer, bytearray(10))
128 self.assertRaises(TypeError, Union.from_buffer, bytearray(10))
[all …]
/external/python/cpython2/Lib/ctypes/test/
Dtest_parameters.py65 self.assertRaises(TypeError, c_char_p.from_param, 42)
78 self.assertRaises(TypeError, c_wchar_p.from_param, 42)
100 self.assertRaises(TypeError, LPINT.from_param, pointer(c_long(42)))
101 self.assertRaises(TypeError, LPINT.from_param, pointer(c_uint(42)))
102 self.assertRaises(TypeError, LPINT.from_param, pointer(c_short(42)))
112 self.assertRaises(TypeError, LPINT.from_param, byref(c_short(22)))
114 self.assertRaises(TypeError, LPINT.from_param, byref(c_long(22)))
115 self.assertRaises(TypeError, LPINT.from_param, byref(c_uint(22)))
124 self.assertRaises(TypeError, LPLPINT.from_param, byref(pointer(c_short(22))))
126 self.assertRaises(TypeError, LPLPINT.from_param, byref(pointer(c_long(22))))
[all …]
Dtest_frombuffer.py35 self.assertRaises(TypeError,
83 self.assertRaises(TypeError, Array.from_buffer, bytearray(10))
84 self.assertRaises(TypeError, Structure.from_buffer, bytearray(10))
85 self.assertRaises(TypeError, Union.from_buffer, bytearray(10))
86 self.assertRaises(TypeError, _CFuncPtr.from_buffer, bytearray(10))
87 self.assertRaises(TypeError, _Pointer.from_buffer, bytearray(10))
88 self.assertRaises(TypeError, _SimpleCData.from_buffer, bytearray(10))
90 self.assertRaises(TypeError, Array.from_buffer_copy, b"123")
91 self.assertRaises(TypeError, Structure.from_buffer_copy, b"123")
92 self.assertRaises(TypeError, Union.from_buffer_copy, b"123")
[all …]
/external/tensorflow/tensorflow/python/framework/
Dop_def_library.py41 raise TypeError("Inconsistent OpDef for '%s', missing attr '%s'" %
48 raise TypeError("Inconsistent OpDef, missing attr '%s' from '%s'." %
56 raise TypeError(
142 raise TypeError("Expected float for argument '%s' not %s." %
149 raise TypeError("Expected int for argument '%s' not %s." %
153 except (ValueError, TypeError):
154 raise TypeError("Expected int for argument '%s' not %s." %
160 raise TypeError("Expected string for argument '%s' not %s." %
167 raise TypeError("Expected bool for argument '%s' not %s." %
175 except TypeError:
[all …]
/external/python/rsa/tests/
Dtest_common.py53 self.assertRaises(TypeError, byte_size, [])
54 self.assertRaises(TypeError, byte_size, ())
55 self.assertRaises(TypeError, byte_size, dict())
56 self.assertRaises(TypeError, byte_size, "")
57 self.assertRaises(TypeError, byte_size, None)
81 self.assertRaises(TypeError, bit_size, [])
82 self.assertRaises(TypeError, bit_size, ())
83 self.assertRaises(TypeError, bit_size, dict())
84 self.assertRaises(TypeError, bit_size, "")
85 self.assertRaises(TypeError, bit_size, None)
[all …]
/external/python/cpython2/Lib/plat-mac/lib-scriptpackages/Netscape/
DMozilla_suite.py23 if _arguments: raise TypeError, 'No optional args expected'
24 if _no_object is not None: raise TypeError, 'No direct arg expected'
43 if _arguments: raise TypeError, 'No optional args expected'
44 if _no_object is not None: raise TypeError, 'No direct arg expected'
63 if _arguments: raise TypeError, 'No optional args expected'
64 if _no_object is not None: raise TypeError, 'No direct arg expected'
109 if _arguments: raise TypeError, 'No optional args expected'
128 if _arguments: raise TypeError, 'No optional args expected'
129 if _no_object is not None: raise TypeError, 'No direct arg expected'
148 if _arguments: raise TypeError, 'No optional args expected'
[all …]
/external/python/cpython3/Lib/idlelib/idle_test/
Dtest_run.py110 self.assertRaises(TypeError, f.read, 1.5)
111 self.assertRaises(TypeError, f.read, '1')
112 self.assertRaises(TypeError, f.read, 1, 1)
135 self.assertRaises(TypeError, f.readlines, 1.5)
136 self.assertRaises(TypeError, f.readlines, '1')
137 self.assertRaises(TypeError, f.readlines, 1, 1)
156 self.assertRaises(TypeError, f.readlines, 1.5)
157 self.assertRaises(TypeError, f.readlines, '1')
158 self.assertRaises(TypeError, f.readlines, 1, 1)
169 self.assertRaises(TypeError, f.close, 1)
[all …]
/external/python/cpython3/Lib/unittest/test/testmock/
Dtestmagicmethods.py24 self.assertRaises(TypeError, lambda: mock['foo'])
30 self.assertRaises(TypeError, lambda: mock['foo'])
53 self.assertRaises(TypeError, lambda: list(mock2))
73 self.assertRaises(TypeError, lambda: mock['foo'])
78 self.assertRaises(TypeError, _del)
79 self.assertRaises(TypeError, _set)
105 self.assertRaises(TypeError, lambda: mock + 3)
117 self.assertRaises(TypeError, iadd, mock)
123 self.assertRaises(TypeError, lambda: 3 + mock)
131 self.assertRaises(TypeError, lambda: mock / 2)
[all …]

12345678910>>...72