This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: `test_enum` contains tests for older versions of python
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ethan.furman Nosy List: ethan.furman, sobolevn
Priority: normal Keywords: patch

Created on 2022-01-10 10:03 by sobolevn, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 30512 merged sobolevn, 2022-01-10 10:07
Messages (3)
msg410194 - (view) Author: Nikita Sobolev (sobolevn) * (Python triager) Date: 2022-01-10 10:03
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.
msg410196 - (view) Author: Nikita Sobolev (sobolevn) * (Python triager) Date: 2022-01-10 10:06
On the other hand second test 

```python
@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.
msg410246 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2022-01-10 19:12
New changeset 13e4659276c2af2fa5b0f2b3a31dcd69064868ef by Nikita Sobolev in branch 'main':
bpo-46327: [Enum] remove skipped tests (GH-30512)
https://github.com/python/cpython/commit/13e4659276c2af2fa5b0f2b3a31dcd69064868ef
History
Date User Action Args
2022-04-11 14:59:54adminsetgithub: 90485
2022-01-10 19:45:16sobolevnsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2022-01-10 19:12:42ethan.furmansetmessages: + msg410246
2022-01-10 10:12:38AlexWaygoodsetassignee: ethan.furman
2022-01-10 10:07:19sobolevnsetkeywords: + patch
stage: patch review
pull_requests: + pull_request28715
2022-01-10 10:06:23sobolevnsetmessages: + msg410196
2022-01-10 10:03:42sobolevncreate