Python and database unittests
marco.bizzarri at gmail.com
Wed Aug 27 09:48:27 CEST 2008
On Tue, Aug 26, 2008 at 11:35 PM, Daniel <daniel.watrous at gmail.com> wrote:
> 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:
> 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?
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.
More information about the Python-list