def setup_streams_fixtures(testcase):
 testcase.mock_tracker = scaffold.MockTracker()
 testcase.stream_file_paths = dict(stdin=tempfile.mktemp(), stdout=tempfile.mktemp(), stderr=tempfile.mktemp())
 testcase.stream_files_by_name = dict(((name, FakeFileDescriptorStringIO()) for name in ['stdin', 'stdout', 'stderr']))
 testcase.stream_files_by_path = dict(((testcase.stream_file_paths[name], testcase.stream_files_by_name[name]) for name in ['stdin', 'stdout', 'stderr']))
 scaffold.mock('os.dup2', tracker=testcase.mock_tracker)

def setup_streams_fixtures ( testcase ) : testcase . mock_tracker = scaffold . MockTracker ( ) testcase . stream_file_paths = dict ( stdin = tempfile . mktemp ( ) , stdout = tempfile . mktemp ( ) , stderr = tempfile . mktemp ( ) ) testcase . stream_files_by_name = dict ( ( ( name , FakeFileDescriptorStringIO ( ) ) for name in [ 'stdin' , 'stdout' , 'stderr' ] ) ) testcase . stream_files_by_path = dict ( ( ( testcase . stream_file_paths [ name ] , testcase . stream_files_by_name [ name ] ) for name in [ 'stdin' , 'stdout' , 'stderr' ] ) ) scaffold . mock ( 'os.dup2' , tracker = testcase . mock_tracker )
set up common test fixtures for standard streams .