I\'ve tried
from mock import Mock
import __builtin__
__builtin__.print = Mock()
But that raises a syntax error. I\'ve also tried patching
print is a keyword in python 2.x, using it as attribute raises a SyntaxError. You can avoid that by using from __future__ import print_function in the beginning of the file.
Note: you can't simply use setattr, because the print function you modified doesn't get invoked unless the print statement is disabled.
Edit: you also need to from __future__ import print_function in every file you want your modified print function to be used, or it will be masked by the print statement.