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.TestCase.run should return result #55616

Closed
voidspace opened this issue Mar 5, 2011 · 3 comments
Closed

unittest.TestCase.run should return result #55616

voidspace opened this issue Mar 5, 2011 · 3 comments
Assignees
Labels
type-bug An unexpected behavior, bug, or error

Comments

@voidspace
Copy link
Contributor

BPO 11407
Nosy @ezio-melotti, @voidspace
Files
  • issue11407.patch: patch to rev 68429:3b489e6beebb
  • 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 = 'https://github.com/voidspace'
    closed_at = <Date 2011-03-14.23:02:35.645>
    created_at = <Date 2011-03-05.13:43:31.184>
    labels = ['type-bug']
    title = 'unittest.TestCase.run should return result'
    updated_at = <Date 2011-03-14.23:02:35.643>
    user = 'https://github.com/voidspace'

    bugs.python.org fields:

    activity = <Date 2011-03-14.23:02:35.643>
    actor = 'python-dev'
    assignee = 'michael.foord'
    closed = True
    closed_date = <Date 2011-03-14.23:02:35.645>
    closer = 'python-dev'
    components = []
    creation = <Date 2011-03-05.13:43:31.184>
    creator = 'michael.foord'
    dependencies = []
    files = ['21131']
    hgrepos = []
    issue_num = 11407
    keywords = ['patch']
    message_count = 3.0
    messages = ['130120', '130882', '130924']
    nosy_count = 4.0
    nosy_names = ['ezio.melotti', 'michael.foord', 'jonathan.hartley', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue11407'
    versions = ['Python 3.3']

    @voidspace
    Copy link
    Contributor Author

    If you call TestCase.run without an argument it will create a default TestResult and use it to execute the test. It should return the result so that you can introspect it.

    @voidspace voidspace self-assigned this Mar 5, 2011
    @voidspace voidspace added the type-bug An unexpected behavior, bug, or error label Mar 5, 2011
    @jonathanhartley
    Copy link
    Mannequin

    jonathanhartley mannequin commented Mar 14, 2011

    Attached patch fixes this.

    TestCase.run now returns its TestResult object, regardless of whether it was passed in or created internally. Test assertions added for this. Invoking an instance of TestCase already returned the return value of .run, so the result is correctly propagated. New test added that verifies that .__call__ delegates to .run.

    Fix for an unrelated minor typo in the docs also bundled into this patch: Fixed the versionchanged:: markup for class TestCase.

    This is my first patch submission, please help me out if I mess it up. Thanks.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Mar 14, 2011

    New changeset b0b7d1d2354c by Michael Foord in branch 'default':
    Closes bpo-11407. TestCase.run returns the result object used or created
    http://hg.python.org/cpython/rev/b0b7d1d2354c

    @python-dev python-dev mannequin closed this as completed Mar 14, 2011
    @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
    type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant