[Python-3000] doctests vs. unittests (was Re: pimp; restructuring the standard library)

Simon Percivall percivall at gmail.com
Sat Jun 30 01:39:43 CEST 2007


On 30 jun 2007, at 01.19, Ron Adam wrote:
> It would be cool if the documents files could also contain the doc  
> tests
> instead of them being in the source code.  I'm sure the could be  
> done now,
> but there isn't a standard way to do this.  Currently I create a  
> seperate
> test module which unclutters the program modules, but then it isn't  
> clear
> these are meant to be documentation first.

Well, there is doctest.testfile, which should do that. It's been
in doctest since 2.4.

//Simon


More information about the Python-3000 mailing list