[issue11389] unittest: no way to control verbosity of doctests from cmd
New submission from anatoly techtonik <techtonik@gmail.com>: I can't find a way to execute DocTests contained in a separate README.txt file using unittest.main() function. That doesn't allow to control verbosity for debugging. I am doing it this way in the tests.py import doctest import unittest if __name__ == '__main__': runner = unittest.TextTestRunner() runner.run(doctest.DocFileSuite('README.txt', optionflags=doctest.ELLIPSIS)) I could find a way to subclass TestLoader.loadTestsFromNames() by looking at the source code of undocumented TestProgram. I'd like to see this use case at least covered by documentation if not properly developed for stdlib of Python4. ---------- assignee: docs@python components: Documentation, Tests messages: 130001 nosy: docs@python, techtonik priority: normal severity: normal status: open title: unittest: no way to control verbosity of doctests from cmd _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue11389> _______________________________________
Terry J. Reedy <tjreedy@udel.edu> added the comment: The undocumented verbosity parameter? ---------- nosy: +michael.foord, terry.reedy _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue11389> _______________________________________
Michael Foord <michael@voidspace.org.uk> added the comment: If the verbosity parameter isn't sufficient (which needs documenting but that is issue 11385) then it would need to be a feature request on DocFileSuite (part of doctest). ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue11389> _______________________________________
anatoly techtonik <techtonik@gmail.com> added the comment: I need to execute doctests along with unit tests from test suite contained in tests.py file and control verbosity parameter in case something goes wrong. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue11389> _______________________________________
Michael Foord <michael@voidspace.org.uk> added the comment: Anatoly, does the verbosity parameter work for you? If not then any feature request / change needs to be for the DocFileSuite as the information is coming from there rather than unittest itself. ---------- assignee: docs@python -> versions: +Python 3.3 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue11389> _______________________________________
Changes by Mark Lawrence <breamoreboy@yahoo.co.uk>: ---------- type: -> behavior versions: +Python 2.7, Python 3.4, Python 3.5 -Python 3.3 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue11389> _______________________________________
Changes by Terry J. Reedy <tjreedy@udel.edu>: ---------- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> TextTestRunner methods are not documented _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue11389> _______________________________________
participants (4)
-
anatoly techtonik
-
Mark Lawrence
-
Michael Foord
-
Terry J. Reedy