Store doctest verbose results to a variable

M

mitchell

Is it possible to store doctest's verbose output to a variable?

For example:

import doctest, my_test_module
a = doctest.testmod(my_test_module)

The contents of 'a' is the tuple of passed and failed results. I tried
passing verbose mode to the testmod function, but 'a' is still a tuple.

Any help is greatly appreciated.
 
F

Fredrik Lundh

mitchell said:
Is it possible to store doctest's verbose output to a variable?

For example:

import doctest, my_test_module
a = doctest.testmod(my_test_module)

The contents of 'a' is the tuple of passed and failed results. I tried
passing verbose mode to the testmod function, but 'a' is still a tuple.

Any help is greatly appreciated.

the third example on this page

http://effbot.org/librarybook/stringio.htm

shows one way to do that.

</F>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top