New submission from Aristotelis Mikropoulos <amik...@gmail.com>:

This is more of a question whether the following is intended behavior:
Subclassing unittest.mock.MagicMock and overriding one of the special (double 
underscore) methods has no effect. The default MagicMock method implementation 
still stands. This isn't the case with subclassing Mock.
It is understood that the purpose of MagicMock is to offer stub implementations 
of certain special methods, but isn't defining them yourself in the body of a 
subclass supposed to override those stubs?
There is an example in the file attached.

----------
components: Tests
files: mockcase.py
messages: 378513
nosy: Indy
priority: normal
severity: normal
status: open
title: Override MagicMock special methods
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file49510/mockcase.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42019>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to