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

A public facing API for __unittest = True #60095

Closed
Julian mannequin opened this issue Sep 9, 2012 · 4 comments
Closed

A public facing API for __unittest = True #60095

Julian mannequin opened this issue Sep 9, 2012 · 4 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@Julian
Copy link
Mannequin

Julian mannequin commented Sep 9, 2012

BPO 15891
Nosy @bitdancer, @voidspace, @Julian, @ericsnowcurrently
Superseder
  • bpo-1705520: API for excluding methods from unittest stack traces
  • 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 2012-09-09.19:36:08.318>
    created_at = <Date 2012-09-09.19:08:04.375>
    labels = ['type-feature', 'library']
    title = 'A public facing API for __unittest = True'
    updated_at = <Date 2012-09-10.14:32:45.374>
    user = 'https://github.com/Julian'

    bugs.python.org fields:

    activity = <Date 2012-09-10.14:32:45.374>
    actor = 'eric.snow'
    assignee = 'none'
    closed = True
    closed_date = <Date 2012-09-09.19:36:08.318>
    closer = 'r.david.murray'
    components = ['Library (Lib)']
    creation = <Date 2012-09-09.19:08:04.375>
    creator = 'Julian'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 15891
    keywords = []
    message_count = 4.0
    messages = ['170126', '170128', '170129', '170191']
    nosy_count = 4.0
    nosy_names = ['r.david.murray', 'michael.foord', 'Julian', 'eric.snow']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'resolved'
    status = 'closed'
    superseder = '1705520'
    type = 'enhancement'
    url = 'https://bugs.python.org/issue15891'
    versions = ['Python 3.3', 'Python 3.4']

    @Julian
    Copy link
    Mannequin Author

    Julian mannequin commented Sep 9, 2012

    Can __unittest = True, which is used to hide stack frames from tracebacks inside the testing framework, be documented as being public, or, if that's not acceptable, be replaced by something that is? _exc_info_to_string is a hairy function to need to rewrite when authoring a testing framework, but it's a rather common thing to want, and would be nice if it was easily done by integrating with what TestCase is already doing.

    It's also (with or without formal blessing) being used in the wild in at least one place I know of here http://bazaar.launchpad.net/~testtools-committers/testtools/trunk/view/head:/testtools/testcase.py#L798 and since it's not terribly critical and will fail rather nicely even if the API changes suddenly I'd bet other places are using it too, though I haven't bothered to check.

    See also http://twistedmatrix.com/trac/ticket/4127 which would be easier to implement if this were acceptable to use for external code.

    @Julian Julian mannequin added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Sep 9, 2012
    @bitdancer
    Copy link
    Member

    This is a duplicate of bpo-1705520. Since Michael obviously hasn't gotten to it yet, a proposed patch might move things along.

    @voidspace
    Copy link
    Contributor

    Whatever we do must be backwards compatible. The question is, is a better api that doesn't use stack frames (which is a hack in my opinion) even possible?

    @ericsnowcurrently
    Copy link
    Member

    yeah, I keep thinking we need a better API for managing tracebacks. One of these days...

    @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-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants