Python and database unittests

Marco Bizzarri marco.bizzarri at
Wed Aug 27 09:48:02 CEST 2008

On Wed, Aug 27, 2008 at 4:55 AM, alex23 <wuwei23 at> wrote:
> Daniel <daniel.watr... at> wrote:
>> Does anyone know about a module that acts as a database stub for
>> python unittests?
> It's not database-specific, but the Mock module should help you here:
> There's even an example on that page for mocking a database.
> --

I strongly disagree on using mocks for a database; checking sequences
of SQL statement is fragile, painful, and leads you to frustration
when the actual SQL and the generated SQL do not match.


Marco Bizzarri

More information about the Python-list mailing list