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

Update PEP 399 to allow for test discovery #61039

Closed
brettcannon opened this issue Jan 1, 2013 · 11 comments
Closed

Update PEP 399 to allow for test discovery #61039

brettcannon opened this issue Jan 1, 2013 · 11 comments
Assignees
Labels
docs Documentation in the Doc dir type-feature A feature request or enhancement

Comments

@brettcannon
Copy link
Member

BPO 16835
Nosy @brettcannon, @pjenvey, @ezio-melotti, @merwok, @zware
Files
  • issue16835.diff
  • issue16835-2.diff
  • issue16835-3.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-01-04.20:27:00.531>
    created_at = <Date 2013-01-01.19:51:45.932>
    labels = ['type-feature', 'docs']
    title = 'Update PEP 399 to allow for test discovery'
    updated_at = <Date 2013-01-04.20:27:00.530>
    user = 'https://github.com/brettcannon'

    bugs.python.org fields:

    activity = <Date 2013-01-04.20:27:00.530>
    actor = 'ezio.melotti'
    assignee = 'ezio.melotti'
    closed = True
    closed_date = <Date 2013-01-04.20:27:00.531>
    closer = 'ezio.melotti'
    components = ['Documentation']
    creation = <Date 2013-01-01.19:51:45.932>
    creator = 'brett.cannon'
    dependencies = []
    files = ['28533', '28539', '28562']
    hgrepos = []
    issue_num = 16835
    keywords = ['patch']
    message_count = 11.0
    messages = ['178748', '178751', '178845', '178847', '178910', '178911', '178948', '179062', '179063', '179076', '179077']
    nosy_count = 5.0
    nosy_names = ['brett.cannon', 'pjenvey', 'ezio.melotti', 'eric.araujo', 'zach.ware']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue16835'
    versions = []

    @brettcannon
    Copy link
    Member Author

    Don't have the base tests inherit from TestCase else they will be discovered by unittest and run even though they are not fully defined.

    See http://bugs.python.org/issue16748 as the trigger for this issue.

    @ezio-melotti ezio-melotti added the docs Documentation in the Doc dir label Jan 1, 2013
    @ezio-melotti ezio-melotti self-assigned this Jan 1, 2013
    @ezio-melotti ezio-melotti added the type-feature A feature request or enhancement label Jan 1, 2013
    @ezio-melotti
    Copy link
    Member

    Here's a patch:

    1. the base class doesn't inherit from TestCase anymore -- the subclasses do;
    2. added a skipUnless() decorator on the C subclass;
    3. used the modern if __name__ == '__main__': unittest.main() idiom;
    4. renamed the AcceleratedExampleTest to CExampleTest (I prefer the PyFoo/CFoo parallel, "Accelerated" doesn't necessarily imply that it's testing the C version);
    5. added a paragraph to explain the idiom;
    6. added Post-History;
    7. did a couple of minor cleanup in the code;

    @pjenvey
    Copy link
    Member

    pjenvey commented Jan 2, 2013

    Hey Ezio, you forgot to attach the patch

    @ezio-melotti
    Copy link
    Member

    That would explain why no one was reviewing it :)

    @zware
    Copy link
    Member

    zware commented Jan 3, 2013

    A few minor grammatical and style nits in the prose added at the end of the diff:

    +The test module defines a base class with the tests methods that access the
    +heapq module through a self.heapq class attribute, and two subclasses
    +that set this attribute to either the Python and C versions of the module.

    I think that should be "Python or C version" (and -> or; versions -> version).

    +Note that only the two subclasses inherit from unittest.TestCase -- this
    +prevents the ExampleTest class to be detected as a TestCase subclass

    "to be" should be "from being", I believe.

    +by unittest test discovery.
    +A skipUnless decorator can be added to the class that tests the C code

    This should either have another newline inbetween or be reflowed. Either one paragraph or two makes sense to me, but I can't tell which way you actually meant it to go which makes for confusing reading of the ReST source.

    As far as the example code changes, those look good to me :)

    @ezio-melotti
    Copy link
    Member

    Thanks for the review, new patch attached.

    This should either have another newline inbetween or be reflowed.
    Either one paragraph or two makes sense to me, but I can't tell which
    way you actually meant

    I meant one and half :)
    I guess in HTML that would have been a <br> inside the <p>, but I don't think it really matters if it's rendered as a single paragraph.

    @ezio-melotti ezio-melotti removed their assignment Jan 3, 2013
    @zware
    Copy link
    Member

    zware commented Jan 3, 2013

    Thanks for the review, new patch attached.

    You're quite welcome. Is there anything I've missed in the process of reviewing itself? This is the first time I've reviewed a patch here...

    I did miss another nit in the prose, though; "the tests methods" in the first line isn't quite right, but I can't decide if it should be "the test's methods" (singular possessive), "the tests' methods" (plural possessive), or "test methods" (non-specific, non-possessive). Any of the three that better gets your point across makes me happy :)

    > This should either have another newline inbetween or be reflowed.
    > Either one paragraph or two makes sense to me, but I can't tell which
    > way you actually meant

    I meant one and half :)
    I guess in HTML that would have been a <br> inside the <p>, but I don't
    think it really matters if it's rendered as a single paragraph.

    I see. As is works for me if it works for you, though I might lean towards rounding it up to 2 paragraphs :)

    @ezio-melotti
    Copy link
    Member

    Attached a new patch.

    @zware
    Copy link
    Member

    zware commented Jan 4, 2013

    Looks good to me :)

    @brettcannon
    Copy link
    Member Author

    LGTM as well. Feel free to commit it, Ezio, or assign to me and I will commit it later (probably this weekend).

    @ezio-melotti
    Copy link
    Member

    Done in http://hg.python.org/peps/rev/3740f42d3b94, thanks for the reviews!

    @ezio-melotti ezio-melotti assigned ezio-melotti and unassigned merwok Jan 4, 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
    docs Documentation in the Doc dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    5 participants