@testing.only_on('sqlite+pysqlite')
@testing.provide_metadata
def test_lastrowid_zero(self):
    from sqlalchemy.dialects import sqlite
    eng = engines.testing_engine()

    class ExcCtx(sqlite.base.SQLiteExecutionContext):

        def get_lastrowid(self):
            return 0
    eng.dialect.execution_ctx_cls = ExcCtx
    t = Table('t', self.metadata, Column('x', Integer, primary_key=True), Column('y', Integer))
    t.create(eng)
    r = eng.execute(t.insert().values(y=5))
    eq_(r.inserted_primary_key, [0])
@testing.only_on('sqlite+pysqlite')
@testing.provide_metadata
def test_lastrowid_zero(self):
    from sqlalchemy.dialects import sqlite
    eng = engines.testing_engine()

    class ExcCtx(sqlite.base.SQLiteExecutionContext):

        def get_lastrowid(self):
            return 0
    eng.dialect.execution_ctx_cls = ExcCtx
    t = Table('t', self.metadata, Column('x', Integer, primary_key=True), Column('y', Integer))
    t.create(eng)
    r = eng.execute(t.insert().values(y=5))
    eq_(r.inserted_primary_key, [0])