[Twisted-Python] Re: [Twisted-commits] r22733 - Add clear() method to TestSuite, play with DocTestSuite (ahah some much fun).

Thomas Hervé therve at free.fr
Sat Mar 1 04:39:49 EST 2008


Jonathan Lange a écrit :
> On Sat, Mar 1, 2008 at 9:02 AM, Thomas Herve
> <therve at wolfwood.twistedmatrix.com> wrote:
>   
>>  @@ -1241,6 +1242,13 @@
>>          return result
>>
>>
>>  +    def clear(self):
>>  +        """
>>  +        Remove all previously added tests.
>>  +        """
>>  +        self._tests = []
>>  +
> What's your plan for making sure this works with stdlib TestSuite?
>
> jml
>   

I haven't think about it much. The tests aren't broken, so the behavior 
is not really defined. I could just check if the method exists, but that 
doesn't seem very nice. Maybe we could have a ITestSuite interface to 
add specific behavior to the twisted TestSuite object (and then check 
the interface). Or maybe I could just let the old self._tests = [], but 
exarkun wasn't very happy about that.

What do you think?

-- 
Thomas





More information about the Twisted-Python mailing list