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

test_descr.py converted to unittest #46229

Closed
amauryfa opened this issue Jan 25, 2008 · 8 comments
Closed

test_descr.py converted to unittest #46229

amauryfa opened this issue Jan 25, 2008 · 8 comments
Labels
tests Tests in the Lib/test dir

Comments

@amauryfa
Copy link
Member

BPO 1935
Nosy @brettcannon, @birkenfeld, @amauryfa
Files
  • test_descr.py: modified from trunk, rev 60301
  • test_descr.py: py3k version, modified from r60302
  • 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 2008-02-02.10:18:52.360>
    created_at = <Date 2008-01-25.23:27:15.296>
    labels = ['tests']
    title = 'test_descr.py converted to unittest'
    updated_at = <Date 2008-02-02.10:18:52.300>
    user = 'https://github.com/amauryfa'

    bugs.python.org fields:

    activity = <Date 2008-02-02.10:18:52.300>
    actor = 'georg.brandl'
    assignee = 'none'
    closed = True
    closed_date = <Date 2008-02-02.10:18:52.360>
    closer = 'georg.brandl'
    components = ['Tests']
    creation = <Date 2008-01-25.23:27:15.296>
    creator = 'amaury.forgeotdarc'
    dependencies = []
    files = ['9290', '9291']
    hgrepos = []
    issue_num = 1935
    keywords = ['patch']
    message_count = 8.0
    messages = ['61696', '61697', '61729', '61816', '61825', '61826', '61827', '61998']
    nosy_count = 3.0
    nosy_names = ['brett.cannon', 'georg.brandl', 'amaury.forgeotdarc']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1935'
    versions = ['Python 2.6']

    @amauryfa
    Copy link
    Member Author

    This is test_descr.py converted to unittest. The diff is so large that
    svn diff failed!
    "svn: Can't write to stream: Not enough space to process this command."
    Anyway, I started from trunk, rev 60301.

    The file is very large, and some functions have more than 400 lines. I
    tried to group them into classes, most of the time respecting the
    initial sequential order, but not always.
    The class and function names may seem arbitrary sometimes. At least, I
    hope that no test was lost in the process. Feel free to reorganize stuff
    if you find a logic in all these tests.

    I removed all print statements, and converted some statements to
    unittest idioms, but not all: lots of "raise TestFailed" remain.

    svn merge into py3k will be difficult; I propose to upload a py3k
    version of this file, which I will make by merging differences between
    trunk and py3k into this new file.

    @amauryfa amauryfa added the tests Tests in the Lib/test dir label Jan 25, 2008
    @amauryfa
    Copy link
    Member Author

    And here is the version for py3k!
    I also removed a few duplicate tests or list items, introduced by
    unicode->str and long->int conversions.

    @brettcannon
    Copy link
    Member

    Just so you know, Amaury, a student did a conversion for GHOP:
    http://code.google.com/p/google-highly-open-participation-psf/issues/detail?id=291
    . It was not checked in yet as we are waiting for contributor forms first.

    But perhaps you can have a look at it and see if there is anything to
    take? I suspect yours is fine (or possibly better since you just have
    more experience than a high schooler; no offense, Jeff), but it wouldn't
    hurt to have a look and just choose one or the other.

    @amauryfa
    Copy link
    Member Author

    On the contrary, Jeff's version is better in many aspects.
    I happily withdraw my submission.

    Just a question: why were the docstrings removed?

    @brettcannon
    Copy link
    Member

    On Jan 29, 2008 3:11 AM, Amaury Forgeot d'Arc <report@bugs.python.org> wrote:

    Amaury Forgeot d'Arc added the comment:

    On the contrary, Jeff's version is better in many aspects.
    I happily withdraw my submission.

    Just a question: why were the docstrings removed?

    Beats me. =) I didn't even notice when I did the initial review.

    @amauryfa
    Copy link
    Member Author

    Did he misunderstand the last comment in this post of yours?
    http://code.google.com/p/google-highly-open-participation-psf/issues/detail?id=291#c24

    @brettcannon
    Copy link
    Member

    On Jan 29, 2008 12:24 PM, Amaury Forgeot d'Arc <report@bugs.python.org> wrote:

    Amaury Forgeot d'Arc added the comment:

    Did he misunderstand the last comment in this post of yours?
    http://code.google.com/p/google-highly-open-participation-psf/issues/detail?id=291#c24

    Ah, I see what you mean.

    So docstrings are not used in testing methods because unittest outputs
    those as the name of the test and they are not always useful. The
    convention is to make them comments instead and let the method test
    name be what unittest outputs.

    @birkenfeld
    Copy link
    Member

    The GHOP patch was now committed as r60521.

    @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
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants