fix sqlite rtree test on windows

This might fix https://github.com/mapnik/mapnik/issues/1871#issuecomment-58107829
I think  del(ds) should work, give it a try.


On 13 October 2014 18:51, Jiri Drbalek <notifications@github.com> wrote:

> In tests/python_tests/sqlite_rtree_test.py:
>
> > -        except sqlite3.OperationalError:
> > -            # don't worry about testing # of index records if
> > -            # python's sqlite module does not support rtree
> > -            pass
> > -        cur.close()
> > +        with sqlite3.connect(index) as conn:
> > +            cur = conn.cursor()
> > +            try:
> > +                cur.execute("Select count(*) from idx_%s_GEOMETRY" % TABLE.replace("'",""))
> > +                conn.commit()
> > +                eq_(cur.fetchone()[0],TOTAL)
> > +            except sqlite3.OperationalError:
> > +                # don't worry about testing # of index records if
> > +                # python's sqlite module does not support rtree
> > +                pass
> > +            cur.close()
> >
> >          ds = mapnik.SQLite(file=DB,table=TABLE)
>
> Is there a way how to manually destroy datasource in Python? Support for
> with statement could be useful.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/mapnik/mapnik/pull/2530/files#r18783558>.
>