Python and database unittests

Simon Brunning simon at
Wed Aug 27 10:26:48 CEST 2008

2008/8/27 Marco Bizzarri <marco.bizzarri at>:
> 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.

Clearly you need integration tests as well as unit tests, but the unit
tests ought to isolate the code under test, so stubbing out external
dependencies is the norm.

Simon B.
simon at
GTalk: simon.brunning | MSN: small_values | Yahoo: smallvalues | Twitter: brunns

More information about the Python-list mailing list