Skip to content

Everything in Mock should inherit from Base #82289

Closed

Description

@lisroach
BPO 38108
Nosy @ezio-melotti, @voidspace, @lisroach, @tirkarthi
PRs
  • bpo-38108: Makes mock objects inherit from Base #16060
  • [3.8] bpo-38108: Makes mock objects inherit from Base (GH-16060) #16470
  • 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/lisroach'
    closed_at = <Date 2019-09-30.04:21:10.488>
    created_at = <Date 2019-09-11.13:24:30.491>
    labels = ['3.8', '3.9']
    title = 'Everything in Mock should inherit from Base'
    updated_at = <Date 2019-09-30.04:21:10.488>
    user = 'https://github.com/lisroach'

    bugs.python.org fields:

    activity = <Date 2019-09-30.04:21:10.488>
    actor = 'lisroach'
    assignee = 'lisroach'
    closed = True
    closed_date = <Date 2019-09-30.04:21:10.488>
    closer = 'lisroach'
    components = []
    creation = <Date 2019-09-11.13:24:30.491>
    creator = 'lisroach'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 38108
    keywords = ['patch']
    message_count = 4.0
    messages = ['351863', '351886', '353478', '353530']
    nosy_count = 4.0
    nosy_names = ['ezio.melotti', 'michael.foord', 'lisroach', 'xtreak']
    pr_nums = ['16060', '16470']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue38108'
    versions = ['Python 3.8', 'Python 3.9']

    Activity

    1. lisroach commented on Sep 11, 2019

      @lisroach
      ContributorAuthor

      Everything within Mock should be inheriting from the top-level parent class, Base (and properly call super).

      For multiple inheritance to work correctly they all should be inheriting from the same parent class ultimately.

      Classes that need update:

      MagicMixin
      AsyncMagicMixin
      NonCallableMock (instance = object.__new__(new) should be switched to a super call here)

    2. self-assigned this
      on Sep 11, 2019
    3. lisroach commented on Sep 11, 2019

      @lisroach
      ContributorAuthor

      Also:

      _AsyncIterator
      _AwaitEvent

      Some of the code in AsyncMagicMixin might be able to be simplified if we inherit from MagicMixin instead, right now we might be duplicating work.

      In general we have to watch out for duplication/overwriting of attributes with this change.

    4. lisroach commented on Sep 29, 2019

      @lisroach
      ContributorAuthor

      New changeset 9a7d951 by Lisa Roach in branch 'master':
      bpo-38108: Makes mock objects inherit from Base (GH-16060)
      9a7d951

    5. lisroach commented on Sep 30, 2019

      @lisroach
      ContributorAuthor

      New changeset b76ab35 by Lisa Roach (Miss Islington (bot)) in branch '3.8':
      bpo-38108: Makes mock objects inherit from Base (GH-16060) (GH-16470)
      b76ab35

    6. 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

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions