def test_make_response_pops_proc(): procs = chain( [Process(['echo', 'm']) for _ in range(2)], [Process(['echo', 'a'])], ) r = Pipe.make_response(procs) assert len(r.history) == 2 assert r.out == 'a\n' assert r.command == ['echo', 'a']
def pipe(): return Pipe( [['cat'], ['grep', 'at']], data=['c\nat\n'], )
def res(request): r = Pipe([['yes'], ['head', '-n', '2']]).run() r.wait() request.addfinalizer(r.close) return r