我试图测试使用Facebook SDK的方法。我的测试看起来像这样(在继承自unittest.TestCase的类中):
@mock.patch.multiple(engine.facebook.GraphAPI,
request=TEST_ME,
extend_access_token=TEST_AUTH_TOKEN)
@mock.patch.object(service.models.Person, "save")
def setUp(self, mock_save, mock_request, mock_extend_access_token):
...
当我尝试运行它时,我收到此错误:
TypeError: setUp() takes exactly 4 arguments (2 given)
我很困惑,因为as far as I can tell, my code is the same as the example in the documentation。我使用Python 2.7和Mock库。我做错了什么?