iteration over methods

Chad Netzer cnetzer at
Tue Jan 7 20:56:49 CET 2003

On Tuesday 07 January 2003 05:14, John Roth wrote:
> "Oliver Vecernik" <vecernik at> wrote in message
> news:3E1AB7B3.4050404 at

> >      def runallmethods(self):
> >          for func in dir(self):
> >              if func[0:4] == 'method':
                         This will never be true.

should be func[0:6] or func[:6]

that said, I agree with John that looking in the unittest
module will be of interest.  In particular, the getTestCaseNames()
method, which works essentially the same way as yours (but uses

Bay Area Python Interest Group -

Chad Netzer
cnetzer at

More information about the Python-list mailing list