2
是什麼蟒蛇模擬和魔法模擬之間的差異,因爲我能看到python mock和magic mock有什麼區別?
>>> dir(Mock()) == dir(MagicMock())
True
時使用模擬OBJ &時使用MagicMock OBJ?
是什麼蟒蛇模擬和魔法模擬之間的差異,因爲我能看到python mock和magic mock有什麼區別?
>>> dir(Mock()) == dir(MagicMock())
True
時使用模擬OBJ &時使用MagicMock OBJ?
MagicMock is a subclass of Mock with default implementations of many magic methods. You can use MagicMock without having to configure the magic methods yourself.
我想上面的代碼是最神奇的方法會影響到你的模擬自動
查閱本指南,它可以幫助你Magic Methods
和官方文檔https://docs.python.org/2/reference/datamodel.html#special-method-names
是什麼那些許多神奇的方法?我可以使用出組態? – Vb407