Python mock.patch: replace a method

I'd like to replace a method in a class with mock: from unittest.mock import patch class A(object): def method(self, string): print(self, "method", string) def method2(self, string):...