Skip to content

Simplify MODULE variable in test_enum.py #90576

Closed

Description

@sobolevn
BPO 46418
Nosy @ethanfurman, @sobolevn
PRs
  • bpo-46418: simplify MODULE declaration in test_enum #30647
  • 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 2022-01-17.21:19:10.061>
    created_at = <Date 2022-01-17.18:50:15.980>
    labels = ['type-bug', 'tests', '3.11']
    title = 'Simplify `MODULE` variable in `test_enum.py`'
    updated_at = <Date 2022-01-17.21:19:10.060>
    user = 'https://github.com/sobolevn'

    bugs.python.org fields:

    activity = <Date 2022-01-17.21:19:10.060>
    actor = 'sobolevn'
    assignee = 'none'
    closed = True
    closed_date = <Date 2022-01-17.21:19:10.061>
    closer = 'sobolevn'
    components = ['Tests']
    creation = <Date 2022-01-17.18:50:15.980>
    creator = 'sobolevn'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46418
    keywords = ['patch']
    message_count = 2.0
    messages = ['410818', '410821']
    nosy_count = 2.0
    nosy_names = ['ethan.furman', 'sobolevn']
    pr_nums = ['30647']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue46418'
    versions = ['Python 3.11']

    Activity

    1. sobolevn commented on Jan 17, 2022

      @sobolevn
      MemberAuthor

      Right now MODULE in Lib/test/test_enum.py is defined as:

      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 #30641

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

      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.

    2. added
      3.11only security fixes
      testsTests in the Lib/test dir
      type-bugAn unexpected behavior, bug, or error
      on Jan 17, 2022
    3. ethanfurman commented on Jan 17, 2022

      @ethanfurman
      Member

      New changeset 596cf51 by Nikita Sobolev in branch 'main':
      bpo-46418: [Enum] simplify MODULE declaration in tests (GH-30647)
      596cf51

    4. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.11only security fixestestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions