MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_tostring_large_executemany

Method test_tostring_large_executemany

test/base/test_except.py:206–320  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

204 )
205
206 def test_tostring_large_executemany(self):
207 try:
208 raise sa_exceptions.DBAPIError.instance(
209 "this is a message",
210 [
211 {1: 1},
212 {1: 1},
213 {1: 1},
214 {1: 1},
215 {1: 1},
216 {1: 1},
217 {1: 1},
218 {1: 1},
219 {1: 1},
220 {1: 1},
221 ],
222 OperationalError("sql error"),
223 DatabaseError,
224 )
225 except sa_exceptions.DBAPIError as exc:
226 eq_(
227 str(exc),
228 "(test.base.test_except.OperationalError) sql error\n"
229 "[SQL: this is a message]\n"
230 "[parameters: [{1: 1}, {1: 1}, {1: 1}, {1: 1}, {1: 1},"
231 " {1: 1}, {1: 1}, {1: 1}, {1: 1}, {1: 1}]]\n"
232 "(Background on this error at: https://sqlalche.me/e/%s/e3q8)"
233 % sa_exceptions._version_token,
234 )
235 eq_(
236 exc.args,
237 ("(test.base.test_except.OperationalError) sql error",),
238 )
239 try:
240 raise sa_exceptions.DBAPIError.instance(
241 "this is a message",
242 [
243 {1: 1},
244 {1: 1},
245 {1: 1},
246 {1: 1},
247 {1: 1},
248 {1: 1},
249 {1: 1},
250 {1: 1},
251 {1: 1},
252 {1: 1},
253 {1: 1},
254 ],
255 OperationalError(),
256 DatabaseError,
257 ismulti=True,
258 )
259 except sa_exceptions.DBAPIError as exc:
260 eq_(
261 str(exc),
262 "(test.base.test_except.OperationalError) \n"
263 "[SQL: this is a message]\n"

Callers

nothing calls this directly

Calls 3

eq_Function · 0.90
instanceMethod · 0.80
OperationalErrorClass · 0.70

Tested by

no test coverage detected