classification
Title: Everything in Mock should inherit from Base
Type: Stage: patch review
Components: Versions: Python 3.9, Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: lisroach Nosy List: ezio.melotti, lisroach, michael.foord, xtreak
Priority: normal Keywords: patch

Created on 2019-09-11 13:24 by lisroach, last changed 2019-09-12 14:48 by lisroach.

Pull Requests
URL Status Linked Edit
PR 16060 open lisroach, 2019-09-12 14:48
Messages (2)
msg351863 - (view) Author: Lisa Roach (lisroach) * (Python committer) Date: 2019-09-11 13:24
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)
msg351886 - (view) Author: Lisa Roach (lisroach) * (Python committer) Date: 2019-09-11 14:00
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.
History
Date User Action Args
2019-09-12 14:48:33lisroachsetkeywords: + patch
stage: patch review
pull_requests: + pull_request15683
2019-09-11 14:00:00lisroachsetmessages: + msg351886
2019-09-11 13:24:30lisroachcreate