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.