'Patch C{sys.stdout} so tests can make assertions about what\'s printed.'

def setUp(self):

    if _PY3:
        self.stdout = StringIO()
    else:
        self.stdout = BytesIO()
    self.patch(sys, 'stdout', self.stdout)
