Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unittest: TestSuite.debug() does not like subTest() #73737

Closed
wrohdewald mannequin opened this issue Feb 14, 2017 · 2 comments
Closed

unittest: TestSuite.debug() does not like subTest() #73737

wrohdewald mannequin opened this issue Feb 14, 2017 · 2 comments
Labels
3.7 (EOL) end of life stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@wrohdewald
Copy link
Mannequin

wrohdewald mannequin commented Feb 14, 2017

BPO 29551
Nosy @pitrou, @rbtcollins, @ezio-melotti, @voidspace, @berkerpeksag
Superseder
  • bpo-34900: unittest subTests() fails when called from debug()
  • Files
  • main.py
  • 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 2018-10-05.10:29:40.884>
    created_at = <Date 2017-02-14.07:10:49.223>
    labels = ['3.7', 'type-bug', 'library']
    title = 'unittest: TestSuite.debug() does not like subTest()'
    updated_at = <Date 2018-10-05.10:29:40.882>
    user = 'https://bugs.python.org/wrohdewald'

    bugs.python.org fields:

    activity = <Date 2018-10-05.10:29:40.882>
    actor = 'berker.peksag'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-10-05.10:29:40.884>
    closer = 'berker.peksag'
    components = ['Library (Lib)']
    creation = <Date 2017-02-14.07:10:49.223>
    creator = 'wrohdewald'
    dependencies = []
    files = ['46637']
    hgrepos = []
    issue_num = 29551
    keywords = []
    message_count = 2.0
    messages = ['287738', '327122']
    nosy_count = 6.0
    nosy_names = ['pitrou', 'rbcollins', 'ezio.melotti', 'michael.foord', 'wrohdewald', 'berker.peksag']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '34900'
    type = 'behavior'
    url = 'https://bugs.python.org/issue29551'
    versions = ['Python 3.5', 'Python 3.6', 'Python 3.7']

    @wrohdewald
    Copy link
    Mannequin Author

    wrohdewald mannequin commented Feb 14, 2017

    the main code is appended in main.py

    if a test uses with self.subTest(), subTest() fails right in its first statement "if not self._outcome ..." because _outcome is None.

    In main.py, the commented runner.run(suite) would work correctly.

    If this is not meant to work, please mention it in the documentation and improve unittest's reaction.

    what I would find more logical from the users's point of view is something like

    runner.debug(suite)

    @wrohdewald wrohdewald mannequin added type-crash A hard crash of the interpreter, possibly with a core dump stdlib Python modules in the Lib dir labels Feb 14, 2017
    @serhiy-storchaka serhiy-storchaka added 3.7 (EOL) end of life type-bug An unexpected behavior, bug, or error and removed type-crash A hard crash of the interpreter, possibly with a core dump labels Feb 14, 2017
    @berkerpeksag
    Copy link
    Member

    Thanks for the report, Wolfgang. The main cause of the issue will be resolved when we merge PR 9707. I'm closing this as a duplicate of bpo-34900 since the latter has already an open PR.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants