Python from Wise Guy's Viewpoint
Pascal Costanza
costanza at web.de
Wed Oct 29 04:21:55 EST 2003
Stephen J. Bevan wrote:
> 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.
These are both all or nothing solutions.
+ "all the tests for a particular feature in one place" - maybe that's
not what I want (and you have ignored my arguments in this regard)
and:
+ what if I want to run _some_ of the tests that my macro produces but
not _all_ of them?
Actually, that seems to be the typical reaction of static typing fans.
This reminds me of a joke.
Imagine yourself back in the 1980's. A general of the former Soviet
Union says: "We can travel anywhere we want." Question: "What about
Great Britain, Italy, France, the US?" "We don't want to travel there."
Pascal
More information about the Python-list
mailing list