def _mock_output(backend):<EOL>
recorded_output = []  <EOL>output_buffer_to_string = backend.output_buffer_to_string<EOL>def record_output():<EOL><INDENT>recorded_output.append(output_buffer_to_string())<EOL><DEDENT>backend.output_buffer_to_string = Mock(  <EOL>wraps=output_buffer_to_string,<EOL>side_effect=record_output)<EOL>def get_output():<EOL><INDENT>backend.output_buffer_to_string = output_buffer_to_string<EOL>return recorded_output[<NUM_LIT:0>] if recorded_output else '<STR_LIT>'<EOL><DEDENT>return get_output<EOL>
Mock out Backend's .emit function, and return a list containing all params
emit was called with.