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

Bdb: add a unittest file (test.test_bdb) #63616

Closed
ColinWilliams mannequin opened this issue Oct 27, 2013 · 17 comments
Closed

Bdb: add a unittest file (test.test_bdb) #63616

ColinWilliams mannequin opened this issue Oct 27, 2013 · 17 comments
Assignees
Labels
3.7 (EOL) end of life tests Tests in the Lib/test dir type-feature A feature request or enhancement

Comments

@ColinWilliams
Copy link
Mannequin

ColinWilliams mannequin commented Oct 27, 2013

BPO 19417
Nosy @terryjreedy, @xdegaye, @Mariatta, @csabella, @miss-islington
PRs
  • bpo-19417: Add test_bdb.py #5217
  • [3.7] bpo-19417: Add test_bdb.py (GH-5217) #6146
  • [3.6] bpo-19417: Add test_bdb.py (GH-5217) #6150
  • [2.7] bpo-19417: Add test_bdb.py (GH-5217) #6156
  • Files
  • bdb.patch
  • bdb.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 = 'https://github.com/terryjreedy'
    closed_at = <Date 2019-04-12.17:46:24.396>
    created_at = <Date 2013-10-27.17:51:48.701>
    labels = ['3.7', 'type-feature', 'tests']
    title = 'Bdb: add a unittest file (test.test_bdb)'
    updated_at = <Date 2019-04-12.17:46:24.396>
    user = 'https://bugs.python.org/ColinWilliams'

    bugs.python.org fields:

    activity = <Date 2019-04-12.17:46:24.396>
    actor = 'xdegaye'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2019-04-12.17:46:24.396>
    closer = 'xdegaye'
    components = ['Tests']
    creation = <Date 2013-10-27.17:51:48.701>
    creator = 'Colin.Williams'
    dependencies = []
    files = ['32389', '32485']
    hgrepos = []
    issue_num = 19417
    keywords = ['patch']
    message_count = 17.0
    messages = ['201481', '201948', '201949', '202041', '202063', '292489', '292492', '292578', '292597', '292599', '292621', '293836', '310157', '314053', '314054', '314105', '325474']
    nosy_count = 6.0
    nosy_names = ['terry.reedy', 'xdegaye', 'Colin.Williams', 'Mariatta', 'cheryl.sabella', 'miss-islington']
    pr_nums = ['5217', '6146', '6150', '6156']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue19417'
    versions = ['Python 2.7', 'Python 3.6', 'Python 3.7']

    @ColinWilliams
    Copy link
    Mannequin Author

    ColinWilliams mannequin commented Oct 27, 2013

    This one is pretty involved. The tests might reach into the guts of the modules a bit too much, I'd be open to less invasive suggestions.

    @terryjreedy
    Copy link
    Member

    Is the patch against 3.4? I am not sure if we backport new test files.

    @terryjreedy terryjreedy added the tests Tests in the Lib/test dir label Nov 1, 2013
    @terryjreedy terryjreedy changed the title bdb test coverage Add tests for bdb (previously not tested) Nov 1, 2013
    @terryjreedy terryjreedy added the type-feature A feature request or enhancement label Nov 1, 2013
    @terryjreedy
    Copy link
    Member

    Does all of the code for say, BdbTestCase.setUp, need to be repeated for each test method, versus being put in a .setUpClass method to be executed just once for all the methods in BdbTestCase.

    @xdegaye
    Copy link
    Mannequin

    xdegaye mannequin commented Nov 3, 2013

    A less invasive alternative could be to instrument Bdb with a subclass
    that processes send-expect sequences. This is what does
    http://code.google.com/p/pdb-clone/source/browse/Lib/test/test_bdb.py

    This code could be adapted to run with python bdb.

    @ColinWilliams
    Copy link
    Mannequin Author

    ColinWilliams mannequin commented Nov 3, 2013

    I've updated the patch to consolidate some duplicated code. Unfortunately, I wasn't able to move anything to setUpClass without messing even more with the internals. I haven't had a chance to refine the code further based on xdegaye's suggestions, but I wanted to make sure I was getting feedback on the most up-to-date code.

    @terryjreedy
    Copy link
    Member

    IDLE's debugger needs multiple patches. It is based on bdb. So I want to be able to understand the bdb code and know that it is sound. The file is nearly devoid of docstrings, so I would like to add those first, probably in a separate patch. A first draft can be derived from the bdb doc. Docstrings will help in reviewing the patch.

    @terryjreedy terryjreedy added the 3.7 (EOL) end of life label Apr 28, 2017
    @terryjreedy terryjreedy changed the title Add tests for bdb (previously not tested) Bdb: add docstrings and a unittest file (test.test_bdb) Apr 28, 2017
    @terryjreedy terryjreedy self-assigned this Apr 28, 2017
    @csabella
    Copy link
    Contributor

    I'll work on the bdb docstrings.

    @xdegaye
    Copy link
    Mannequin

    xdegaye mannequin commented Apr 29, 2017

    The file is nearly devoid of docstrings, so I would like to add those first, probably in a separate patch.

    Please move this new request for enhancement to a separate issue.

    @terryjreedy
    Copy link
    Member

    While I have previously done docstrings and tests together, I can see that for this issue, separation might be preferable. Cherl, can you open a new issue and re-title the PR? (I don't know if that will be sufficient to 'move' it, but I hope so.)

    @csabella
    Copy link
    Contributor

    Moved to bpo-30211 for docstrings.

    @terryjreedy terryjreedy changed the title Bdb: add docstrings and a unittest file (test.test_bdb) Bdb: add a unittest file (test.test_bdb) Apr 29, 2017
    @xdegaye
    Copy link
    Mannequin

    xdegaye mannequin commented Apr 30, 2017

    Thanks Terry and Cheryl for splitting the issue :)

    @csabella
    Copy link
    Contributor

    Wondering if it might make sense to use Mock in this patch?

    @xdegaye
    Copy link
    Mannequin

    xdegaye mannequin commented Jan 17, 2018

    PR 5217 adds the test.test_bdb module and provides a framework for adding more tests to the bdb module.

    Added versions 3.6 and 2.7. This is consistent with what was done in issues bpo-21916 and bpo-25616 for example, but the main reason is that most bdb bug fixes need to be backported to the maintenance and 2.7 versions and should use the same test case whenever possible.

    @Mariatta
    Copy link
    Member

    New changeset 3fe3304 by Mariatta (xdegaye) in branch 'master':
    bpo-19417: Add test_bdb.py (GH-5217)
    3fe3304

    @miss-islington
    Copy link
    Contributor

    New changeset fdd8e8b by Miss Islington (bot) in branch '3.7':
    bpo-19417: Add test_bdb.py (GH-5217)
    fdd8e8b

    @Mariatta
    Copy link
    Member

    New changeset 424f3da by Mariatta (xdegaye) in branch '3.6':
    bpo-19417: Add test_bdb.py (GH-5217)
    424f3da

    @miss-islington
    Copy link
    Contributor

    New changeset 57e70d3 by Miss Islington (bot) (xdegaye) in branch '2.7':
    [2.7] bpo-19417: Add test_bdb.py (GH-5217) (GH-6156)
    57e70d3

    @xdegaye xdegaye mannequin closed this as completed Apr 12, 2019
    @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
    3.7 (EOL) end of life tests Tests in the Lib/test dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants