def addError(self, test, err): current_stream = self.stream self.stream = _WritelnDecorator(sys.stderr) TextTestResult.addError(self, test, err) self.stream = current_stream