def setUp(self): import sys import StringIO self.stderr_str = StringIO.StringIO() sys.stderr = self.stderr_str self.logger = Logger()