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: Simplify `MODULE` variable in `test_enum.py`
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: ethan.furman, sobolevn
Priority: normal Keywords: patch

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

Pull Requests
URL Status Linked Edit
PR 30647 merged sobolevn, 2022-01-17 18:52
Messages (2)
msg410818 - (view) Author: Nikita Sobolev (sobolevn) * (Python triager) Date: 2022-01-17 18:50
Right now `MODULE` in Lib/test/test_enum.py is defined as:

```python
MODULE = ('test.test_enum', '__main__')[__name__=='__main__'] 
```

I dived into history and did not find any reasoning why it should not be just `__name__`. (But, I might had missed it: the first usage of it is dated back to 2016)

This came up in https://github.com/python/cpython/pull/30641

So, I think it is a good idea to simplify it like this:

```python
MODULE = __name__
```

Probably, this won't cause any more confusion in the future :)

I am not going to change all `MODULE` usages to `__name__` to keep the diff as minimal as possible.
msg410821 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2022-01-17 20:17
New changeset 596cf51a4d40f1ac3090cbccb83ad0663d739ae2 by Nikita Sobolev in branch 'main':
bpo-46418: [Enum] simplify `MODULE` declaration in tests (GH-30647)
https://github.com/python/cpython/commit/596cf51a4d40f1ac3090cbccb83ad0663d739ae2
History
Date User Action Args
2022-04-11 14:59:54adminsetgithub: 90576
2022-01-17 21:19:10sobolevnsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2022-01-17 20:17:05ethan.furmansetmessages: + msg410821
2022-01-17 18:52:16sobolevnsetkeywords: + patch
stage: patch review
pull_requests: + pull_request28849
2022-01-17 18:50:15sobolevncreate