Propagating poorly chosen idioms

Skip Montanaro skip at pobox.com
Tue Apr 5 13:20:47 EDT 2005


    Peter> unitttest is surely not the be all and end all of Python unit
    Peter> testing frameworks...  but it's one of the batteries included in
    Peter> the standard distribution, and it's pretty trivial to get started
    Peter> using it, unless maybe you try to go by the documentation instead
    Peter> of by the examples...

This reminded me of something I noticed awhile ago.  If you're learning
something new, there is a tendency to find a working example to start from,
then modify it to suit your needs.  This is fine as far as it goes, however,
if the idioms used in the code you're cloning are suboptimal, they get
cloned.

Unittest's API is difficult enough for me to remember (at least the initial
framework I need to put together) that I generally hunt down some previous
unittest usage, clone it and start from there.  I no longer have any idea
what the original unittest example was that got me started using it in the
first place (probably something in the distro's docs).  I can only hope it
was a good example.

>From that standpoint the simpler API of py.test seems attractive.

Skip



More information about the Python-list mailing list