Python and database unittests
marco.bizzarri at gmail.com
Wed Aug 27 09:48:02 CEST 2008
On Wed, Aug 27, 2008 at 4:55 AM, alex23 <wuwei23 at gmail.com> wrote:
> Daniel <daniel.watr... at gmail.com> 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.
More information about the Python-list