[TIP] database regression testing
Kumar McMillan
kumar.mcmillan at gmail.com
Wed Apr 9 12:29:56 PDT 2008
On Wed, Apr 9, 2008 at 9:41 AM, Nate Lowrie <solodex2151 at gmail.com> wrote:
> Do we have something similar to
> SQLUnit in Python? Any recommendations?
The way I have done what SQLUnit does in Python is for my suite to
create a test database (yes a real one), load up some data in setUp(),
call the stored procedure, make some selects to assert it did the
right thing, then delete the data in tearDown(). I even created a
module to help with the setup/teardown/assertion part :
http://code.google.com/p/fixture/ ... however, it is slightly annoying
because you have to use an ORM (sqlalchemy, sqlobject) and that can
impose some limitations and complications. I also have an unfinished
work branch supporting sqlalchemy 0.4, hopefully it will be released
soon. Anyway, this is just a concept. You can still accomplish this
without using the fixture module. Just put SQL insert statements in
your setUp() and delete statements in tearDown(). At work we do have
a test suite in Python entirely dedicated to stored procedures and
triggers that maintain fact tables and other data warehouse / star
schema type of stuff.
Kumar
More information about the testing-in-python
mailing list