MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_statement_error_no_code

Method test_statement_error_no_code

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

Source from the content-addressed store, hash-verified

105 )
106
107 def test_statement_error_no_code(self):
108 try:
109 raise sa_exceptions.DBAPIError.instance(
110 "select * from table",
111 [{"x": 1}],
112 sa_exceptions.InvalidRequestError("hello"),
113 DatabaseError,
114 )
115 except sa_exceptions.StatementError as err:
116 eq_(
117 str(err),
118 "(sqlalchemy.exc.InvalidRequestError) hello\n"
119 "[SQL: select * from table]\n[parameters: [{'x': 1}]]",
120 )
121 eq_(err.args, ("(sqlalchemy.exc.InvalidRequestError) hello",))
122
123 def test_statement_error_w_code(self):
124 try:

Callers

nothing calls this directly

Calls 2

eq_Function · 0.90
instanceMethod · 0.80

Tested by

no test coverage detected