def METHOD_NAME(self):
    with self.create_app().app_context():
        session = db.session
        dataset = (
            session.query(SqlaTable).filter_by(table_name="dummy_sql_table").first()
        )
        slice = Slice(
            datasource_id=dataset.id,
            datasource_type=DatasourceType.TABLE,
            datasource_name="tmp_perm_table",
            slice_name="slice_name",
        )
        session.add(slice)
        session.commit()
        yield slice
        # rollback
        session.delete(slice)
        session.commit()