[Biopython-dev] BioSQL tests

Peter Cock p.j.a.cock at googlemail.com
Fri Aug 17 16:42:57 UTC 2012


Dear all,

I realised this week that I didn't have a working BioSQL
test setup under either MySQL or PostgreSQL, and
the buildbot machines are not testing these either.
Therefore I have re-factored the BioSQL unit tests as
follows:

First I turned my print-and-compare test_BioSQL_SeqIO.py
script into proper UnitTest based tests, so that all the BioSQL
tests could be combined in one file, test_BioSQL.py.

This allowed a further reorganisation to allow any one
machine to test all the supported back ends one after
the other - previously the setup only tested one backend
(defaulting to SQLite3). We now have three test scripts
named after the backend library used to connect to the
database:

test_BioSQL_MySQLdb.py
test_BioSQL_psycopg2.py
test_BioSQL_sqlite3.py

Subsequently I modified our TravisCI configuration to
install the required dependencies to run all these tests.
The default usernames and passwords for MySQLdb
and postgresql are set to match those under TravisCI.
Local users would probably have to adjust these values
(in the same way they used to prior to the refactoring).

Note that psycopg2 only works on C Python 2 & 3 for
now (there is a PyPy alternative I have not looked into).

MySQLdb only works on C Python 2 (there is a problem
installing it under Python 3.2).

This did show I'd broken using BioSQL under MySQLdb,
at least under this particular version, fixed now:
https://github.com/biopython/biopython/commit/4a67d851d1eda0a138b604c8aeffc151d331a29b

So the good news is that now TravisCI will run the
BioSQL tests on all three database backends, on
several versions of Python (but just on Linux).
http://travis-ci.org/biopython/biopython/

What I have not addressed is if/how we should deal
with test database setting under buildbot - perhaps by
environment variable overrides?

If anyone would like to look into using MySQLdb and/or
psycopg2 under PyPy and Jython, that would also be
useful too.

Regards,

Peter



More information about the Biopython-dev mailing list