(self, local_connection)
| 179 | savepoint.rollback() |
| 180 | |
| 181 | def test_commit_fails_flat(self, local_connection): |
| 182 | connection = local_connection |
| 183 | |
| 184 | t1 = connection.begin() |
| 185 | |
| 186 | with mock.patch.object( |
| 187 | connection, |
| 188 | "_commit_impl", |
| 189 | mock.Mock(side_effect=exc.DBAPIError("failure", None, None, None)), |
| 190 | ): |
| 191 | assert_raises_message(exc.DBAPIError, r"failure", t1.commit) |
| 192 | |
| 193 | assert not t1.is_active |
| 194 | t1.rollback() # no error |
| 195 | |
| 196 | def test_commit_fails_ctxmanager(self, local_connection): |
| 197 | connection = local_connection |
nothing calls this directly
no test coverage detected