def METHOD_NAME(self):
    # If an unicode arg is passed, sep and end should be unicode, too.
    class Recorder(object):
        def __init__(self, must_be_unicode):
            self.buf = []
            self.force_unicode = must_be_unicode
        def write(self, what):
            if self.force_unicode and not isinstance(what, unicode):
                raise AssertionError("{0!r} is not unicode".format(what))
            self.buf.append(what)
    buf = Recorder(True)
    print(u'hi', file=buf)
    self.assertEqual(u''.join(buf.buf), 'hi\n')
    del buf.buf[:]
    print(u'hi', u'nothing', file=buf)
    self.assertEqual(u''.join(buf.buf), 'hi nothing\n')
    buf = Recorder(False)
    print('hi', 'bye', end=u'\n', file=buf)
    self.assertIsInstance(buf.buf[1], unicode)
    self.assertIsInstance(buf.buf[3], unicode)
    del buf.buf[:]
    print(sep=u'x', file=buf)
    self.assertIsInstance(buf.buf[-1], unicode)