'stop capturing and reset capturing streams'

def stop_capturing(self):

    if hasattr(self, '_reset'):
        raise ValueError('was    already    stopped')
    self._reset = True
    if self.out:
        self.out.done()
    if self.err:
        self.err.done()
    if self.in_:
        self.in_.done()
