MagicMock has default implementation of every one of the python's magic methods. That's why It can be named MagicMock. Here is the list of all magic solutions rszalski.github.io/magicmethods.AscalonianAscalonian 15.2k1919 gold badges7575 silver badges107107 bronze badges two one I think This could be ok In case the constructor initializes the value