

def subprocess_mock(mox, *args, **kw):
    mock_process = mox.CreateMock(subprocess.Popen)
    mox.StubOutWithMock(subprocess, 'Popen', use_mock_anything=True)
    subprocess.Popen(*args, **kw).AndReturn(mock_process)
    return mock_process

dataset/ETHPy150Open timvideos/streaming-system/tools/portable/portable_platform_test.py subprocess_mock/original