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 creates non-picklable errors #67092

Closed
pitrou opened this issue Nov 19, 2014 · 7 comments
Closed

unittest creates non-picklable errors #67092

pitrou opened this issue Nov 19, 2014 · 7 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@pitrou
Copy link
Member

pitrou commented Nov 19, 2014

BPO 22903
Nosy @pitrou, @rbtcollins, @ezio-melotti, @bitdancer, @voidspace, @ethanfurman, @serhiy-storchaka
Files
  • pickle_module_import_failure.patch
  • 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 2015-03-18.23:02:13.894>
    created_at = <Date 2014-11-19.19:49:12.708>
    labels = ['type-bug']
    title = 'unittest creates non-picklable errors'
    updated_at = <Date 2015-03-18.23:02:13.893>
    user = 'https://github.com/pitrou'

    bugs.python.org fields:

    activity = <Date 2015-03-18.23:02:13.893>
    actor = 'pitrou'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-03-18.23:02:13.894>
    closer = 'pitrou'
    components = []
    creation = <Date 2014-11-19.19:49:12.708>
    creator = 'pitrou'
    dependencies = []
    files = ['38548']
    hgrepos = []
    issue_num = 22903
    keywords = ['patch']
    message_count = 7.0
    messages = ['231398', '231399', '238474', '238476', '238478', '238480', '238481']
    nosy_count = 8.0
    nosy_names = ['pitrou', 'rbcollins', 'ezio.melotti', 'r.david.murray', 'michael.foord', 'ethan.furman', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue22903'
    versions = ['Python 3.4', 'Python 3.5']

    @pitrou
    Copy link
    Member Author

    pitrou commented Nov 19, 2014

    Just got this:

    _pickle.PicklingError: Can't pickle <class 'unittest.loader.ModuleImportFailure'>: attribute lookup ModuleImportFailure on unittest.loader failed

    unittest should use regular exception classes instead.

    @bitdancer
    Copy link
    Member

    They aren't "real" exceptions, though, if I understand correctly.

    @pitrou
    Copy link
    Member Author

    pitrou commented Mar 18, 2015

    Here is a patch.

    @pitrou pitrou added the type-bug An unexpected behavior, bug, or error label Mar 18, 2015
    @serhiy-storchaka
    Copy link
    Member

    classname is not used in _make_failed_test().

    @rbtcollins
    Copy link
    Member

    LGTM please commit.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Mar 18, 2015

    New changeset f3977f34cf6c by Antoine Pitrou in branch '3.4':
    Issue bpo-22903: The fake test case created by unittest.loader when it fails importing a test module is now picklable.
    https://hg.python.org/cpython/rev/f3977f34cf6c

    New changeset a1b5ac563d8d by Antoine Pitrou in branch 'default':
    Issue bpo-22903: The fake test case created by unittest.loader when it fails importing a test module is now picklable.
    https://hg.python.org/cpython/rev/a1b5ac563d8d

    @pitrou
    Copy link
    Member Author

    pitrou commented Mar 18, 2015

    Thanks!

    @pitrou pitrou closed this as completed Mar 18, 2015
    @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

    4 participants