Python and database unittests

Marco Bizzarri marco.bizzarri at gmail.com
Wed Aug 27 03:48:27 EDT 2008


On Tue, Aug 26, 2008 at 11:35 PM, Daniel <daniel.watrous at gmail.com> wrote:
> Hello,
>
> I'm writing an application that interacts with a database.  As I think
> about how to write the unittests, I want them to be able to run
> without actually having to access a live database.  The pattern that
> best describes this is here:
>
> http://martinfowler.com/eaaCatalog/serviceStub.html
>
> I have found http://qualitylabs.org/pdbseed/, which helps with
> unittests for a live database.  This isn't what I'm after.
>
> Does anyone know about a module that acts as a database stub for
> python unittests?
>
> Thanks,
> Daniel
> --
> http://mail.python.org/mailman/listinfo/python-list
>


I think you're pointing to the wrong direction, if you want to make a
servicestub; the service should encapsulate your access to the
database (or whatever external resource you want to access), and,
after that, it should be transparent for you, more or less.

Regards
Marco


-- 
Marco Bizzarri
http://iliveinpisa.blogspot.com/



More information about the Python-list mailing list