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

Rewrite test_dbm #89663

Closed
serhiy-storchaka opened this issue Oct 17, 2021 · 5 comments
Closed

Rewrite test_dbm #89663

serhiy-storchaka opened this issue Oct 17, 2021 · 5 comments
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes tests Tests in the Lib/test dir type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 45500
Nosy @ambv, @serhiy-storchaka, @corona10
PRs
  • bpo-45500: Rewrite test_dbm #29002
  • [3.10] bpo-45500: Rewrite test_dbm (GH-29002) #29069
  • [3.9] bpo-45500: Rewrite test_dbm (GH-29002) #29074
  • 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 2021-10-20.08:29:13.961>
    created_at = <Date 2021-10-17.09:55:33.220>
    labels = ['type-feature', 'tests', '3.9', '3.10', '3.11']
    title = 'Rewrite test_dbm'
    updated_at = <Date 2021-10-20.08:29:13.960>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2021-10-20.08:29:13.960>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-10-20.08:29:13.961>
    closer = 'serhiy.storchaka'
    components = ['Tests']
    creation = <Date 2021-10-17.09:55:33.220>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 45500
    keywords = ['patch']
    message_count = 5.0
    messages = ['404131', '404336', '404346', '404399', '404401']
    nosy_count = 3.0
    nosy_names = ['lukasz.langa', 'serhiy.storchaka', 'corona10']
    pr_nums = ['29002', '29069', '29074']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue45500'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    @serhiy-storchaka
    Copy link
    Member Author

    • Generate test classes at import time. It allows to filter them when run with unittest. E.g: "./python -m unittest test.test_dbm.TestCase_gnu -v".
    • Create a database class in a new directory which will be removed after test. It guarantees that all created files and directories be removed and will not conflict with other dbm tests.
    • Restore dbm._defaultmod after tests. Previously it was set to the last dbm module (dbm.dumb) which affected other tests.
    • Enable the whichdb test for dbm.dumb.
    • Move test_keys to the correct test class. It does not test whichdb().
    • Remove some outdated code and comments.

    @serhiy-storchaka serhiy-storchaka added 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes tests Tests in the Lib/test dir type-feature A feature request or enhancement labels Oct 17, 2021
    @ambv
    Copy link
    Contributor

    ambv commented Oct 19, 2021

    New changeset 975b94b by Serhiy Storchaka in branch 'main':
    bpo-45500: Rewrite test_dbm (GH-29002)
    975b94b

    @ambv
    Copy link
    Contributor

    ambv commented Oct 19, 2021

    New changeset 325b2c2 by Łukasz Langa in branch '3.10':
    [3.10] bpo-45500: Rewrite test_dbm (GH-29002) (GH-29069)
    325b2c2

    @corona10
    Copy link
    Member

    New changeset d46b221 by Łukasz Langa in branch '3.9':
    [3.9] bpo-45500: Rewrite test_dbm (GH-29002) (GH-29074)
    d46b221

    @serhiy-storchaka
    Copy link
    Member Author

    Thanks Łukasz and Dong-hee Na.

    @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.9 only security fixes 3.10 only security fixes 3.11 only security fixes tests Tests in the Lib/test dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants