[Twisted-Python] Re: [Twisted-commits] r15100 - So I really do want this stuff

Jean-Paul Calderone exarkun at divmod.com
Sat Nov 12 22:12:03 MST 2005


On Sun, 13 Nov 2005 12:33:41 +1100, Jonathan Lange <jml at mumak.net> wrote:
>On 13/11/05, James Y Knight <foom at fuhm.net> wrote:
>> On Nov 12, 2005, at 4:34 PM, Jonathan Lange wrote:
>> > On 13/11/05, James Y Knight <foom at fuhm.net> wrote:
>> >>
>> >> Maybe this is a stupid question, but I'm confused as to why the
>> >> implementation isn't straightforward, something along the lines of
>> >> the following:
>> >>
>> >> for each module to test:
>> >>    for each class that is a subclass of TestCase in module:
>> >>      testCase = class()
>> >>      testCase.setUpClass()
>> >>      for each method in testCase:
>> >>        testCase.setUp()
>> >>        testCase.method()
>> >>        testCase.tearDown()
>> >>      testCase.tearDownClass()
>> >>
>> >> Now I now it has to be somewhat more complicated, due to error
>> >> handling, deferred handling, suppress, etc, but it does seem like
>> >> that would be the outline...can it not be?
>> >>
>> >
>> > The short answer: An instance of a TestCase subclass represents a
>> > single test.
>>
>> But not to the user...if I set attributes on the instance, they stay
>> set across all test methods.
>
>This is a bug, not a feature.

Why is it a bug?

Jean-Paul




More information about the Twisted-Python mailing list