Home
last modified time | relevance | path

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

12345678910>>...108

/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())
183 self.assertRaises(TypeError, getargs_B, 3.14)
186 self.assertRaises(TypeError, getargs_B, BadIndex())
190 self.assertRaises(TypeError, getargs_B, Int())
192 self.assertRaises(TypeError, getargs_B, BadInt())
193 self.assertRaises(TypeError, getargs_B, BadInt2())
[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)
89 self.assertRaises(TypeError, operator.ne)
100 self.assertRaises(TypeError, operator.ge)
101 self.assertRaises(TypeError, operator.ge, 1j, 2j)
111 self.assertRaises(TypeError, operator.gt)
112 self.assertRaises(TypeError, operator.gt, 1j, 2j)
[all …]
Dtest_positional_only_arg.py73 …with self.assertRaisesRegex(TypeError, r"f\(\) got some positional-only arguments passed as keywor…
77 …with self.assertRaisesRegex(TypeError, r"f\(\) got some positional-only arguments passed as keywor…
86 …with self.assertRaisesRegex(TypeError, r"f\(\) got some positional-only arguments passed as keywor…
90 …with self.assertRaisesRegex(TypeError, r"f\(\) got some positional-only arguments passed as keywor…
124 with self.assertRaisesRegex(TypeError, expected):
130 with self.assertRaisesRegex(TypeError, expected):
136 with self.assertRaisesRegex(TypeError, expected):
142 … with self.assertRaisesRegex(TypeError, r"f\(\) missing 1 required positional argument: 'c'"):
144 …with self.assertRaisesRegex(TypeError, r"f\(\) missing 2 required positional arguments: 'b' and 'c…
146 …with self.assertRaisesRegex(TypeError, r"f\(\) missing 3 required positional arguments: 'a', 'b', …
[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)
222 raise TypeError("don't know how to handle %r" % exc)
229 raise TypeError("don't know how to handle %r" % exc)
293 self.assertRaises(TypeError, exctype, *args[:-1])
295 self.assertRaises(TypeError, exctype, *(args + ["too much"]))
309 self.assertRaises(TypeError, exctype, *callargs)
389 TypeError,
[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 …]
Dtest_call.py35 self.assertRaisesRegex(TypeError, msg, {}.__contains__)
39 self.assertRaisesRegex(TypeError, msg, {}.__contains__, 0, 1)
43 self.assertRaisesRegex(TypeError, msg, int.from_bytes, b'a', 'little', False)
47 self.assertRaisesRegex(TypeError, msg, {}.get)
50 self.assertRaisesRegex(TypeError, msg, {}.__delattr__)
54 self.assertRaisesRegex(TypeError, msg, getattr)
58 self.assertRaisesRegex(TypeError, msg, input, 1, 2)
62 self.assertRaisesRegex(TypeError, msg, {}.get, 1, 2, 3)
66 self.assertRaisesRegex(TypeError, msg, {}.__contains__, x=2)
70 self.assertRaisesRegex(TypeError, msg, {}.__contains__, x=2, y=2)
[all …]
Dstring_tests.py75 except TypeError:
126 self.checkraises(TypeError, 'hello', 'count')
131 self.checkraises(TypeError, 'hello', 'count', 42)
176 self.checkraises(TypeError, 'hello', 'find')
181 self.checkraises(TypeError, 'hello', 'find', 42)
234 self.checkraises(TypeError, 'hello', 'rfind')
239 self.checkraises(TypeError, 'hello', 'rfind', 42)
288 self.checkraises(TypeError, 'hello', 'index')
293 self.checkraises(TypeError, 'hello', 'index', 42)
314 self.checkraises(TypeError, 'hello', 'rindex')
[all …]
Dtest_builtin.py163 self.assertRaises(TypeError, __import__, 1, 2, 3, 4)
165 self.assertRaises(TypeError, __import__, 'sys', name='sys')
185 self.assertRaises(TypeError, abs, 'a')
190 self.assertRaises(TypeError, abs)
191 self.assertRaises(TypeError, abs, None)
202 self.assertRaises(TypeError, all, 10) # Non-iterable
203 self.assertRaises(TypeError, all) # No args
204 self.assertRaises(TypeError, all, [2, 4, 6], []) # Too many args
217 self.assertRaises(TypeError, any, 10) # Non-iterable
218 self.assertRaises(TypeError, any) # No args
[all …]
/third_party/mindspore/tests/ut/python/nn/
Dtest_checkparameter.py29 with pytest.raises(TypeError):
33 with pytest.raises(TypeError):
37 with pytest.raises(TypeError):
41 with pytest.raises(TypeError):
43 with pytest.raises(TypeError):
56 with pytest.raises(TypeError):
60 with pytest.raises(TypeError):
73 with pytest.raises(TypeError):
77 with pytest.raises(TypeError):
90 with pytest.raises(TypeError):
[all …]
Dtest_dynamic_lr.py36 with pytest.raises(TypeError):
45 with pytest.raises(TypeError):
50 with pytest.raises(TypeError):
55 with pytest.raises(TypeError):
60 with pytest.raises(TypeError):
63 with pytest.raises(TypeError):
76 with pytest.raises(TypeError):
86 with pytest.raises(TypeError):
96 with pytest.raises(TypeError):
99 with pytest.raises(TypeError):
[all …]
/third_party/mindspore/tests/st/ops/ascend/
Dtest_autocast.py169 with pytest.raises(TypeError):
171 with pytest.raises(TypeError):
173 with pytest.raises(TypeError):
175 with pytest.raises(TypeError):
177 with pytest.raises(TypeError):
179 with pytest.raises(TypeError):
181 with pytest.raises(TypeError):
183 with pytest.raises(TypeError):
185 with pytest.raises(TypeError):
187 with pytest.raises(TypeError):
[all …]
/third_party/jerryscript/tests/jerry/es2015/
Dbuiltin-prototypes.js27 TypeError.prototype,
39 assert (e instanceof TypeError);
46 assert (e instanceof TypeError);
53 assert (e instanceof TypeError);
60 assert (e instanceof TypeError);
67 assert (e instanceof TypeError);
74 assert (e instanceof TypeError);
81 assert (e instanceof TypeError);
88 assert (e instanceof TypeError);
95 assert (e instanceof TypeError);
[all …]
Dproxy_call.js41 assert (e instanceof TypeError);
65 assert (e instanceof TypeError)
73 assert (e instanceof TypeError)
235 assert (e instanceof TypeError);
267 assert (e instanceof TypeError);
274 assert (e instanceof TypeError);
281 assert (e instanceof TypeError);
288 assert (e instanceof TypeError);
295 assert (e instanceof TypeError);
302 assert (e instanceof TypeError);
[all …]
/third_party/mindspore/tests/ut/python/ops/
Dtest_nn_ops_check.py50 'block': (P.Flatten(), {'exception': TypeError, 'error_keywords': ['Flatten']}),
61 'block': (P.Softmax(), {'exception': TypeError, 'error_keywords': ['Softmax']}),
77 'block': (P.LogSoftmax(), {'exception': TypeError, 'error_keywords': ['LogSoftmax']}),
88 'block': (P.ReLU(), {'exception': TypeError, 'error_keywords': ['ReLU']}),
93 'block': (P.ReLU(), {'exception': TypeError, 'error_keywords': ['ReLU']}),
99 'block': (P.ReLU6(), {'exception': TypeError, 'error_keywords': ['ReLU6']}),
104 'block': (P.ReLU6(), {'exception': TypeError, 'error_keywords': ['ReLU6']}),
110 'block': (P.Elu(), {'exception': TypeError, 'error_keywords': ['Elu']}),
115 'block': (P.Elu(), {'exception': TypeError, 'error_keywords': ['Elu']}),
121 'block': (P.Sigmoid(), {'exception': TypeError, 'error_keywords': ['Sigmoid']}),
[all …]
Dtest_math_ops_check.py90 'block': (AssignAddNet(), {'exception': TypeError, 'error_keywords': ['AssignAdd']}),
96 'block': (AssignSubNet(), {'exception': TypeError, 'error_keywords': ['AssignSub']}),
103 {'exception': TypeError, 'error_keywords': ['ReduceMean']}),
116 {'exception': TypeError, 'error_keywords': ['ReduceSum']}),
129 {'exception': TypeError, 'error_keywords': ['ReduceAll']}),
142 {'exception': TypeError, 'error_keywords': ['ReduceMax']}),
155 {'exception': TypeError, 'error_keywords': ['ReduceMin']}),
168 {'exception': TypeError, 'error_keywords': ['ReduceProd']}),
181 {'exception': TypeError, 'error_keywords': ['CumProd']}),
187 {'exception': TypeError, 'error_keywords': ['CumProd']}),
[all …]
Dtest_array_ops_check.py62 'block': (P.ExpandDims(), {'exception': TypeError, 'error_keywords': ['ExpandDims']}),
67 'block': (P.ExpandDims(), {'exception': TypeError, 'error_keywords': ['ExpandDims']}),
83 'block': (P.DType(), {'exception': TypeError, 'error_keywords': ['DType']}),
89 'block': (P.SameTypeShape(), {'exception': TypeError, 'error_keywords': ['SameTypeShape']}),
94 'block': (P.SameTypeShape(), {'exception': TypeError, 'error_keywords': ['SameTypeShape']}),
99 'block': (P.SameTypeShape(), {'exception': TypeError, 'error_keywords': ['SameTypeShape']}),
110 'block': (P.IsSubClass(), {'exception': TypeError, 'error_keywords': ['IsSubClass']}),
115 'block': (P.IsSubClass(), {'exception': TypeError, 'error_keywords': ['IsSubClass']}),
121 'block': (IsInstanceNet(5.0), {'exception': TypeError, 'error_keywords': ['IsInstance']}),
127 'block': (P.Reshape(), {'exception': TypeError, 'error_keywords': ['Reshape']}),
[all …]
/third_party/node/test/parallel/
Dtest-buffer-fakes.js14 }, TypeError);
18 }, TypeError);
22 }, TypeError);
26 }, TypeError);
30 }, TypeError);
34 }, TypeError);
38 }, TypeError);
42 }, TypeError);
46 }, TypeError);
50 }, TypeError);
[all …]
/third_party/jerryscript/tests/jerry/es5.1/
Dobject-methods.js19 assert (e instanceof TypeError);
27 assert (e instanceof TypeError);
35 assert (e instanceof TypeError);
43 assert (e instanceof TypeError);
51 assert (e instanceof TypeError);
59 assert (e instanceof TypeError);
67 assert (e instanceof TypeError);
74 assert (e instanceof TypeError);
81 assert (e instanceof TypeError);
88 assert (e instanceof TypeError);
/third_party/node/lib/internal/
Derrors.js52 TypeError,
791 E('ERR_AMBIGUOUS_ARGUMENT', 'The "%s" argument is ambiguous. %s', TypeError);
792 E('ERR_ARG_NOT_ITERABLE', '%s must be iterable', TypeError);
794 E('ERR_ASYNC_CALLBACK', '%s must be a function', TypeError);
795 E('ERR_ASYNC_TYPE', 'Invalid name for async "type": %s', TypeError);
818 'Console expects a writable stream instance for %s', TypeError);
823 E('ERR_CRYPTO_ECDH_INVALID_FORMAT', 'Invalid ECDH format: %s', TypeError);
836 E('ERR_CRYPTO_INVALID_DIGEST', 'Invalid digest: %s', TypeError);
838 'Invalid key object type %s, expected %s.', TypeError);
865 }, TypeError);
[all …]
/third_party/python/Lib/ctypes/test/
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 …]
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 …]
/third_party/mindspore/tests/ut/python/pynative_mode/nn/
Dtest_checkparameter.py47 with pytest.raises(TypeError):
52 with pytest.raises(TypeError):
57 with pytest.raises(TypeError):
70 with pytest.raises(TypeError):
75 with pytest.raises(TypeError):
80 with pytest.raises(TypeError):
93 with pytest.raises(TypeError):
98 with pytest.raises(TypeError):
103 with pytest.raises(TypeError):
108 with pytest.raises(TypeError):
/third_party/mindspore/tests/ut/python/nn/probability/bijector/
Dtest_bijector.py82 with pytest.raises(TypeError):
86 with pytest.raises(TypeError):
88 with pytest.raises(TypeError):
90 with pytest.raises(TypeError):
102 with pytest.raises(TypeError):
104 with pytest.raises(TypeError):
106 with pytest.raises(TypeError):
108 with pytest.raises(TypeError):
117 with pytest.raises(TypeError):
121 with pytest.raises(TypeError):
[all …]
/third_party/mindspore/mindspore/graph_utils/python_pass/
Dpython_pass_register.py43 raise TypeError(f"Expect bool, got : ({type(requires_grad)}){requires_grad}")
45 raise TypeError(f"Expect bool, got : ({type(run_only_once)}){run_only_once}")
52 raise TypeError(f"Expect function pass, got : ({type(py_pass)}){py_pass}")
56 raise TypeError(f"Expect pattern of Pattern type, got : ({type(pattern)}){pattern}")
58 raise TypeError(f"Expect target of Pattern type, got : ({type(target)}){target}")
68 raise TypeError(f"Expect py_pass to be string or function, got ({type(py_pass)}){py_pass}")
76 raise TypeError(f"Expect pattern to be a NewParameter Pattern, got {pattern}")
81 raise TypeError(f"Expect should_renorm to be a bool, got {should_renorm}")
86 raise TypeError(f"Expect do_reopt to be a bool, got {do_reopt}")
169 raise TypeError(f"Expect pattern to be a NewParameter Pattern, got {pattern}")

12345678910>>...108