)]}'
{"tests/v1_1/test_shell.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"a4c8cf91d4f3523c1872ea5780a37d0811cf2ec0","unresolved":false,"context_lines":[{"line_number":74,"context_line":"    def run_command(self, cmd, suppress_output\u003dTrue):"},{"line_number":75,"context_line":"        if suppress_output:"},{"line_number":76,"context_line":"            with mock.patch(\u0027sys.stdout\u0027, StringIO.StringIO()):"},{"line_number":77,"context_line":"                self.shell.main(cmd.split())"},{"line_number":78,"context_line":"        else:"},{"line_number":79,"context_line":"            self.shell.main(cmd.split())"},{"line_number":80,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOH%2F%2F1aM%3D","line":77,"updated":"2013-03-25 18:15:05.000000000","message":"Let me suggest that you add \"return sys.stdout.getvalue()\" right after self.shell.main(), still in the \u0027with\u0027 block.  The sys.stdout patch should only be in place for the duration of the \u0027with\u0027 block, meaning that accessing it after run_command() returns is likely to not work.  By returning the value from stdout directly, you can test it.\n\nYou might also consider just dropping the suppress_output option entirely and *always* patching sys.stdout, returning the value as I describe above.  Then, there\u0027s no need to specify \"suppress_output\u003dFalse\"; if you want the standard output, you simply grab the return value of run_command() and test against that.","commit_id":"a112feb395fb9eb2653f9a5326d08fb577e7ffe9"}]}
