'Create a non-blocking pipe which will be closed after the currently
running test.'

def pipe(self):

    (read, write) = os.pipe()
    self.addCleanup(os.close, read)
    self.addCleanup(os.close, write)
    setNonBlocking(read)
    setNonBlocking(write)
    return (read, write)
