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.TestProgram uses sys.exit() #46926

Closed
tuben mannequin opened this issue Apr 23, 2008 · 4 comments
Closed

unittest.TestProgram uses sys.exit() #46926

tuben mannequin opened this issue Apr 23, 2008 · 4 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@tuben
Copy link
Mannequin

tuben mannequin commented Apr 23, 2008

BPO 2674
Nosy @facundobatista, @devdanzin
Superseder
  • bpo-3379: Option to not-exit on test
  • 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 2009-04-07.16:05:23.937>
    created_at = <Date 2008-04-23.13:59:46.348>
    labels = ['type-bug', 'library']
    title = 'unittest.TestProgram uses sys.exit()'
    updated_at = <Date 2009-04-07.16:05:23.936>
    user = 'https://bugs.python.org/tuben'

    bugs.python.org fields:

    activity = <Date 2009-04-07.16:05:23.936>
    actor = 'ajaksu2'
    assignee = 'none'
    closed = True
    closed_date = <Date 2009-04-07.16:05:23.937>
    closer = 'ajaksu2'
    components = ['Library (Lib)']
    creation = <Date 2008-04-23.13:59:46.348>
    creator = 'tuben'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 2674
    keywords = []
    message_count = 4.0
    messages = ['65698', '69530', '69946', '85724']
    nosy_count = 4.0
    nosy_names = ['facundobatista', 'tuben', 'ajaksu2', 'pupeno']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = None
    status = 'closed'
    superseder = '3379'
    type = 'behavior'
    url = 'https://bugs.python.org/issue2674'
    versions = ['Python 2.5']

    @tuben
    Copy link
    Mannequin Author

    tuben mannequin commented Apr 23, 2008

    The class TestProgram (and its synonym "main") in module unittest is
    (probably) meant to be an easy way to use the functionality of the
    module unittest. It is very surprising (and error-prone) that it uses
    sys.exit() with a status code instead of making a return with the same
    status code.

    Clean-up actions after the call to unittest.main() are not executed.

    @tuben tuben mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Apr 23, 2008
    @facundobatista
    Copy link
    Member

    That class is normally used at the end of the testing suite, as is
    recommended in the documentation.

    In any case, I don't see that like a bug, so we shouldn't be changing
    that behaviour, because of compatibility.

    What do you think? Maybe the documentation should be more explicit about
    this? Thanks!

    @pupeno
    Copy link
    Mannequin

    pupeno mannequin commented Jul 18, 2008

    I was bothered by this 'bug' ages ago, and I was work-arounding it. So
    now I've spent some time in 'fixing' it with the patches on issue bpo-3379.

    @devdanzin
    Copy link
    Mannequin

    devdanzin mannequin commented Apr 7, 2009

    Closing as bpo-3379 has more discussion and patch.

    @devdanzin devdanzin mannequin closed this as completed Apr 7, 2009
    @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
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant