On Mon, 20 Jan 2014 00:10:55 -0500, Olemis Lang <[email protected]>
wrote :

> >
> > Currently on trunk I got a lot of similar mistakes when running the
> > test on bloodhound_search like this one:
> >
> > ======================================================================
> > ERROR: test_admin_granted_in_product_should_not_have_access
> > (bhsearch.tests.security.MultiProductSecurityTestCase)
> > ----------------------------------------------------------------------
> > Traceback (most recent call last):
> [...]
> > OperationalError: duplicate column name: product
> >
> > Does that ring a bell to someone ?
> >
> 
> It looks ok to me , see http://pastebin.com/kxvua4TU
> 

Hello !

I found the problem.

In tests/env.py we have:
from sqlite3 import OperationalError

And in trac/trac/db/sqlite_backend.py we have:
try:
    import pysqlite2.dbapi2 as sqlite
    have_pysqlite = 2
except ImportError:
    try:
        import sqlite3 as sqlite
        have_pysqlite = 2
    except ImportError:
        have_pysqlite = 0

As I have both sqlite3 and python-pysqlite2 installed, I got a mismatch
when an exception is raised:
sqlite3.OperationalError != pysqlite2.dbapi2.OperationalError

And the tests cannot run.

If I deinstall python-pysqlite2, then the tests can run.

Do you think it is necessary to fix this ?
In test files we can reproduce the same logic as in the sqlite_backend
to correctly import sqlite.

Best regards,

Reply via email to