def __call__(self, test): # Executed in child process kwargs = self.runner_args # Force recording of output in a buffer (it will be printed out # by the parent). kwargs["stream"] = StringIO() runner = self.runner_cls(**kwargs) result = runner._makeResult() # Avoid child tracebacks when Ctrl-C is pressed. signals.installHandler() signals.registerResult(result) result.failfast = runner.failfast result.buffer = runner.buffer with self.cleanup_object(test): test(result) # HACK as cStringIO.StringIO isn't picklable in 2.x result.stream = _FakeStringIO(result.stream.getvalue()) return _MinimalResult(result)
def __call__(self, test): # Executed in child process kwargs = self.runner_args # Force recording of output in a buffer (it will be printed out # by the parent). kwargs['stream'] = StringIO() runner = self.runner_cls(**kwargs) result = runner._makeResult() # Avoid child tracebacks when Ctrl-C is pressed. signals.installHandler() signals.registerResult(result) result.failfast = runner.failfast result.buffer = runner.buffer with self.cleanup_object(test): test(result) # HACK as cStringIO.StringIO isn't picklable in 2.x result.stream = _FakeStringIO(result.stream.getvalue()) return _MinimalResult(result, test.id())