I have a faulty third party python module that is outputing to stdout or stderr while it is imported and this is breaking the output of my unittests.
How can I temporary redirect the stdout in order to hide its output.
Limit to Python 2.5 syntax 🙂
Update, I forgot to mention that sys.stdout and sys.__stderr__ methods do not work in this case. As far as I know this faulty module is using native code.
You can do it something like this: