| 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: |