[Tutor] doctest

Patric Michael patric at usa.net
Sun Jan 2 05:01:51 CET 2005


> Also, anything I can do... Presently, since I'm running windows xp, I
> would have to hunt for the command prompt and type in the command

Click Start, click Run, type CMD, press Enter.

Voila!  :)

Patric


> 
> '"C:\python24\python.exe" "C:\documents and
> settings\jacob\desktop\working python programs\testmodules.py" -v'
> 
> ...or make a batch file to do it for me...
> How can I make testmodules.py (shown below) append the -v to itself?
> Is there a self.results or something in testmod?
> 
> ## testmodules.py ###########
> import doctest
> 
> modtotest = 'FractionReducer2'
> 
> exec "import %s" % modtotest
> doctest.testmod(eval(modtotest))
> raw_input()
> #############################
> 
> 
> Thanks,
> Jacob Schmidt
> 
> 
> > What docs are you looking at?? The module docs at
> http://docs.python.org/lib/module-doctest.html
> > have a complete example of testing a module with a main function. Or
> > you
> can use the code in my last
> > post.
> >
> > Kent
> >
> > Jacob S. wrote:
> > > Hi.
> > >
> > >     Okay, so I look at the documentation at it says (in my words):
> > >
> > > "First Class - DocTest -- Make a test object with such and such
> attributes
> > > that you can test.
> > > Second Class - i don't remember the name - Make Jacob look stupid
> > > with
> big
> > > words
> > > Third Class - DocTestSuite - Convert a doctest object to a
> > > unittest
> object -
> > > Okay... so how does that help?
> > > Fourth Class - DocTestFinder - Find the docstrings that contain
> > > test
> code
> > > and extract them."
> > >
> > > So, my question, I guess, is How did the documentation help, and,
> > > How do
> I
> > > have doctest test all of my module's function's docstrings?
> > >
> > > Thanks in advance,
> > > Jacob Schmidt
> > >
> > > _______________________________________________
> > > Tutor maillist  -  Tutor at python.org
> > > http://mail.python.org/mailman/listinfo/tutor
> > >
> > _______________________________________________
> > Tutor maillist  -  Tutor at python.org
> > http://mail.python.org/mailman/listinfo/tutor
> >
> >
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
> 




More information about the Tutor mailing list