Skip to content

unittest: no way to control verbosity of doctests from cmd #55598

Closed

Description

@techtonik
mannequin
BPO 11389
Nosy @terryjreedy, @voidspace
Superseder
  • bpo-11385: [doc] TextTestRunner documentation improvements
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2014-07-02.22:41:57.654>
    created_at = <Date 2011-03-03.19:57:24.734>
    labels = ['type-bug', 'tests', 'docs']
    title = 'unittest: no way to control verbosity of doctests from cmd'
    updated_at = <Date 2014-07-02.22:41:57.654>
    user = 'https://bugs.python.org/techtonik'

    bugs.python.org fields:

    activity = <Date 2014-07-02.22:41:57.654>
    actor = 'terry.reedy'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-07-02.22:41:57.654>
    closer = 'terry.reedy'
    components = ['Documentation', 'Tests']
    creation = <Date 2011-03-03.19:57:24.734>
    creator = 'techtonik'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 11389
    keywords = []
    message_count = 5.0
    messages = ['130001', '130091', '130092', '130178', '130180']
    nosy_count = 4.0
    nosy_names = ['terry.reedy', 'techtonik', 'michael.foord', 'docs@python']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '11385'
    type = 'behavior'
    url = 'https://bugs.python.org/issue11389'
    versions = ['Python 2.7', 'Python 3.4', 'Python 3.5']

    Activity

    1. techtonik commented on Mar 3, 2011

      techtonikmannequin
      MannequinAuthor

      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.

    2. added
      docsDocumentation in the Doc dir
      testsTests in the Lib/test dir
      on Mar 3, 2011
    3. terryjreedy commented on Mar 5, 2011

      @terryjreedy
      Member

      The undocumented verbosity parameter?

    4. voidspace commented on Mar 5, 2011

      @voidspace
      Contributor

      If the verbosity parameter isn't sufficient (which needs documenting but that is bpo-11385) then it would need to be a feature request on DocFileSuite (part of doctest).

    5. techtonik commented on Mar 6, 2011

      techtonikmannequin
      MannequinAuthor

      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.

    6. voidspace commented on Mar 6, 2011

      @voidspace
      Contributor

      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.

    7. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      docsDocumentation in the Doc dirtestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions