pass
except:
self.fail("should have raised ProgrammingError")
+ with self.assertRaisesRegexp(sqlite.ProgrammingError,
+ r'^Base Cursor\.__init__ not called\.$'):
+ cur.close()
def CheckConnectionConstructorCallCheck(self):
"""
PyObject* pysqlite_cursor_close(pysqlite_Cursor* self, PyObject* args)
{
+ if (!self->connection) {
+ PyErr_SetString(pysqlite_ProgrammingError,
+ "Base Cursor.__init__ not called.");
+ return NULL;
+ }
if (!pysqlite_check_thread(self->connection) || !pysqlite_check_connection(self->connection)) {
return NULL;
}