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

Move tests from setobject.c to _testcapimodule #91288

Closed
arhadthedev opened this issue Mar 26, 2022 · 1 comment
Closed

Move tests from setobject.c to _testcapimodule #91288

arhadthedev opened this issue Mar 26, 2022 · 1 comment
Labels
3.11 only security fixes tests Tests in the Lib/test dir topic-C-API type-feature A feature request or enhancement

Comments

@arhadthedev
Copy link
Member

BPO 47132
Nosy @rhettinger, @arhadthedev
PRs
  • gh-91288: Move set.test_c_api to _testcapimodule.test_set #32133
  • 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 = None
    created_at = <Date 2022-03-26.19:16:33.510>
    labels = ['expert-C-API', 'type-feature', 'tests', '3.11']
    title = 'Move tests from setobject.c to _testcapimodule'
    updated_at = <Date 2022-03-27.04:32:59.942>
    user = 'https://github.com/arhadthedev'

    bugs.python.org fields:

    activity = <Date 2022-03-27.04:32:59.942>
    actor = 'Dennis Sweeney'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Tests', 'C API']
    creation = <Date 2022-03-26.19:16:33.510>
    creator = 'arhadthedev'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 47132
    keywords = ['patch']
    message_count = 1.0
    messages = ['416083']
    nosy_count = 2.0
    nosy_names = ['rhettinger', 'arhadthedev']
    pr_nums = ['32133']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue47132'
    versions = ['Python 3.11']

    @arhadthedev
    Copy link
    Member Author

    Currently, tests for PySet/PyFrozenSet C API are defined in Objects/setobject.c and available via set.test_c_api().

    Moving them to, for example, _testcapimodule gives the following advantanges:

    • an internal, CPython-specific method stops being available in a public interface of the set class

    • CPython already has tests grouped into dedicated packages

    • the target package undefines NDEBUG thus making asserts available in release builds

    • a user may choose to omit the tests from a build not carrying them around

    • a file of 2.5k lines of codes becomes 152 lines smaller.

    @arhadthedev arhadthedev added 3.11 only security fixes tests Tests in the Lib/test dir topic-C-API type-feature A feature request or enhancement labels Mar 26, 2022
    @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.11 only security fixes tests Tests in the Lib/test dir topic-C-API type-feature A feature request or enhancement
    Projects
    None yet
    Development

    Successfully merging a pull request may close this issue.

    2 participants