Python and database unittests

Marco Bizzarri marco.bizzarri at gmail.com
Wed Aug 27 04:34:05 EDT 2008


On Wed, Aug 27, 2008 at 10:26 AM, Simon Brunning
<simon at brunningonline.net> wrote:
> 2008/8/27 Marco Bizzarri <marco.bizzarri at gmail.com>:
>> 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.


I agree with you about stubbing external dependencies; I'm just
suggesting to stub the stuff a little further, so that you're not
exposed to actual SQL code.



Regards
Marco


> --
> Cheers,
> Simon B.
> simon at brunningonline.net
> http://www.brunningonline.net/simon/blog/
> GTalk: simon.brunning | MSN: small_values | Yahoo: smallvalues | Twitter: brunns
> --
> http://mail.python.org/mailman/listinfo/python-list
>





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



More information about the Python-list mailing list