Python from Wise Guy's Viewpoint
Stephen J. Bevan
stephen at dino.dnsalias.com
Tue Oct 28 22:01:15 EST 2003
Pascal Costanza <costanza at web.de> writes:
> > Perhaps I'm just a low tech kind of guy but if I just want to run the
> > first ten then I comment out the rest. Even without a fancy IDE that
> > only take a few key presses.
>
> ...and it requires you to go to all the places where they are defined.
>
> Yes, I know the answer: "But they should be all in one place." No,
> they shouldn't need to be all in one place.
As I wrote, I'm a low tech guy, I put all the tests for a particular
feature in the same file. If I only want to run some of the tests in
the file then I comment out those tests. If I only want to run the
tests in some file rather than others then I comment out the names of
the files containing the tests I don't want to run. I can see how
things can get more complicated if you use other approaches, which is
one of the reasons I don't use those approaches. YMMV.
> Ah, another example: What if my test code is actually produced by some
> macro, or some other code generation facility?
Er, comment out either definition of the macro and the calls to it or
the code generation facility.
More information about the Python-list
mailing list