python-mock: 'self' parameter lacking default value
问题 This used to work with python mock version 1.0.1, but started failing after I upgraded to mock version 1.3.0. I am running python version 2.7.10 on Mac OS X Yosemite 10.10.5. I reduced the logic from an existing production test to the following dummy test that reproduces the issue: import unittest import mock from mock import Mock, patch class Outer(object): class MyClass(object): def doStuff(self, action): pass @patch.object(Outer, "MyClass", autospec=True, return_value=Mock(spec_set=Outer