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

concurrent.futures tests don't adher to test_cases protocol #58615

Closed
anacrolix mannequin opened this issue Mar 25, 2012 · 5 comments
Closed

concurrent.futures tests don't adher to test_cases protocol #58615

anacrolix mannequin opened this issue Mar 25, 2012 · 5 comments
Labels
tests Tests in the Lib/test dir type-feature A feature request or enhancement

Comments

@anacrolix
Copy link
Mannequin

anacrolix mannequin commented Mar 25, 2012

BPO 14407
Nosy @brianquinlan, @pitrou, @anacrolix, @zware, @serhiy-storchaka
Files
  • test_concurrent_futures-load_tests-protocol.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 2013-10-15.21:25:15.392>
    created_at = <Date 2012-03-25.18:44:35.343>
    labels = ['type-feature', 'tests']
    title = "concurrent.futures tests don't adher to test_cases protocol"
    updated_at = <Date 2013-10-16.01:31:30.557>
    user = 'https://github.com/anacrolix'

    bugs.python.org fields:

    activity = <Date 2013-10-16.01:31:30.557>
    actor = 'zach.ware'
    assignee = 'none'
    closed = True
    closed_date = <Date 2013-10-15.21:25:15.392>
    closer = 'pitrou'
    components = ['Tests']
    creation = <Date 2012-03-25.18:44:35.343>
    creator = 'anacrolix'
    dependencies = []
    files = ['25021']
    hgrepos = []
    issue_num = 14407
    keywords = ['patch']
    message_count = 5.0
    messages = ['156766', '199990', '200020', '200021', '200032']
    nosy_count = 6.0
    nosy_names = ['bquinlan', 'pitrou', 'anacrolix', 'python-dev', 'zach.ware', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue14407'
    versions = ['Python 3.3', 'Python 3.4']

    @anacrolix
    Copy link
    Mannequin Author

    anacrolix mannequin commented Mar 25, 2012

    matt@matt-1005P:~/src/cpython$ ./python -m unittest test.test_concurrent_futures
    Ran 79 tests in 62.554s

    FAILED (errors=18)

    Failures are due to test discovery picking up unintentionally exposed tests. By adhering to the test_cases protocol introduced in 3.2, this doesn't occur.

    Patch attached.

    @anacrolix anacrolix mannequin added tests Tests in the Lib/test dir type-feature A feature request or enhancement labels Mar 25, 2012
    @pitrou
    Copy link
    Member

    pitrou commented Oct 15, 2013

    I think the better solution would be to fix the test inheritance hierarchy: only concrete test classes should inherit from unittest.TestCase.

    Then the code can be simplified by simply calling unittest.main(name).

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 15, 2013

    New changeset 38243a0a1f44 by Antoine Pitrou in branch '3.3':
    Issue bpo-14407: Fix unittest test discovery in test_concurrent_futures.
    http://hg.python.org/cpython/rev/38243a0a1f44

    New changeset 9cc40bc5f02b by Antoine Pitrou in branch 'default':
    Issue bpo-14407: Fix unittest test discovery in test_concurrent_futures.
    http://hg.python.org/cpython/rev/9cc40bc5f02b

    @pitrou
    Copy link
    Member

    pitrou commented Oct 15, 2013

    Fixed, thanks for reporting!

    @pitrou pitrou closed this as completed Oct 15, 2013
    @zware
    Copy link
    Member

    zware commented Oct 16, 2013

    I had missed this issue before; bpo-16968 tracks the same thing.

    There are a couple of issues that the committed patch doesn't address. Namely, the file still uses test_main, and there is no thread or process reaping when running the file via discovery.

    Unfortunately, there's no clear-cut best solution in the other issue. A couple months ago, Serhiy posted a question on python-dev[1] about how to solve it, which I haven't seen any replies to. Antoine, do you have any suggestions?

    [1] https://mail.python.org/pipermail/python-dev/2013-August/127893.html

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

    No branches or pull requests

    2 participants