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

Fix test discovery for test_future* #61505

Closed
zware opened this issue Feb 26, 2013 · 4 comments
Closed

Fix test discovery for test_future* #61505

zware opened this issue Feb 26, 2013 · 4 comments
Assignees
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@zware
Copy link
Member

zware commented Feb 26, 2013

BPO 17303
Nosy @brettcannon, @ezio-melotti, @zware
Files
  • test_future_discovery.diff
  • 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/ezio-melotti'
    closed_at = <Date 2013-02-27.08:03:53.861>
    created_at = <Date 2013-02-26.21:38:25.626>
    labels = ['type-bug', 'tests']
    title = 'Fix test discovery for test_future*'
    updated_at = <Date 2013-02-27.08:03:53.860>
    user = 'https://github.com/zware'

    bugs.python.org fields:

    activity = <Date 2013-02-27.08:03:53.860>
    actor = 'ezio.melotti'
    assignee = 'ezio.melotti'
    closed = True
    closed_date = <Date 2013-02-27.08:03:53.861>
    closer = 'ezio.melotti'
    components = ['Tests']
    creation = <Date 2013-02-26.21:38:25.626>
    creator = 'zach.ware'
    dependencies = []
    files = ['29252']
    hgrepos = []
    issue_num = 17303
    keywords = ['patch']
    message_count = 4.0
    messages = ['183092', '183093', '183118', '183119']
    nosy_count = 4.0
    nosy_names = ['brett.cannon', 'ezio.melotti', 'python-dev', 'zach.ware']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue17303'
    versions = ['Python 3.3', 'Python 3.4']

    @zware
    Copy link
    Member Author

    zware commented Feb 26, 2013

    Here's the fix for test discovery of test_future* (particularly test_future3). Without the patch, running 'python -m unittest discover Lib/test/ "test_future*"' results in an error in test_future3.py, due to test_future.py's FutureTest.test_future3 removing test_future3 from sys.modules by way of support.unload. The patch replaces all instances of support.unload with a support.CleanImport context manager.

    The patch also replaces test_main() in all test_future*.py modules, just for good measure.

    @zware zware added tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Feb 26, 2013
    @zware
    Copy link
    Member Author

    zware commented Feb 26, 2013

    Correction: ...all instances of support.unload *in test_future.py* with support.CleanImport...

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Feb 27, 2013

    New changeset 83ae10bf608c by Ezio Melotti in branch '3.3':
    bpo-17303: test_future* now work with unittest test discovery. Patch by Zachary Ware.
    http://hg.python.org/cpython/rev/83ae10bf608c

    New changeset 5599bbc275bc by Ezio Melotti in branch 'default':
    bpo-17303: merge with 3.3.
    http://hg.python.org/cpython/rev/5599bbc275bc

    @ezio-melotti
    Copy link
    Member

    Fixed, thanks for the patch!
    I also removed a some "from test import support" that were no longer necessary.

    test_future files could be reorganized a bit, since they are basically no-ops, and they aren't testing much.

    @ezio-melotti ezio-melotti self-assigned this Feb 27, 2013
    @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
    tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants