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_enum contains tests for older versions of python #90485

Closed
sobolevn opened this issue Jan 10, 2022 · 3 comments
Closed

test_enum contains tests for older versions of python #90485

sobolevn opened this issue Jan 10, 2022 · 3 comments
Assignees
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

BPO 46327
Nosy @ethanfurman, @sobolevn
PRs
  • bpo-46327: remove skipped tests from test_enum #30512
  • 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/ethanfurman'
    closed_at = <Date 2022-01-10.19:45:16.665>
    created_at = <Date 2022-01-10.10:03:42.924>
    labels = ['type-bug', 'tests', '3.9', '3.10', '3.11']
    title = '`test_enum` contains tests for older versions of python'
    updated_at = <Date 2022-01-10.19:45:16.665>
    user = 'https://github.com/sobolevn'

    bugs.python.org fields:

    activity = <Date 2022-01-10.19:45:16.665>
    actor = 'sobolevn'
    assignee = 'ethan.furman'
    closed = True
    closed_date = <Date 2022-01-10.19:45:16.665>
    closer = 'sobolevn'
    components = ['Tests']
    creation = <Date 2022-01-10.10:03:42.924>
    creator = 'sobolevn'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46327
    keywords = ['patch']
    message_count = 3.0
    messages = ['410194', '410196', '410246']
    nosy_count = 2.0
    nosy_names = ['ethan.furman', 'sobolevn']
    pr_nums = ['30512']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue46327'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    @sobolevn
    Copy link
    Member Author

    Here's the problem: https://github.com/python/cpython/blob/main/Lib/test/test_enum.py#L4515-L4531

    Why it is a problem?

    1. First test is marked as @unittest.skipUnless(python_version == (3, 8). Which means it is only executed on 3.8. I think it should be removed from more recent branches
    2. Second test is marked as @unittest.skipUnless(python_version >= (3, 9). Which means that it will be executed on three currently supported branches. I think we can remove this decorator

    I will send a PR today.

    @sobolevn sobolevn added 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Jan 10, 2022
    @sobolevn
    Copy link
    Member Author

    On the other hand second test

    @unittest.skipUnless(python_version >= (3, 9),
                             '_convert was removed in 3.9')
        def test_convert_raise(self):
            with self.assertRaises(AttributeError):
                enum.IntEnum._convert(
                    'UnittestConvert',
                    MODULE,
                    filter=lambda x: x.startswith('CONVERT_TEST_'))

    can also be removed if needed.

    @ethanfurman
    Copy link
    Member

    New changeset 13e4659 by Nikita Sobolev in branch 'main':
    bpo-46327: [Enum] remove skipped tests (GH-30512)
    13e4659

    @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-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants