'L{twisted.python.log.showwarning} passes warnings with an explicit file
target on to the underlying Python warning system.'

def test_warningToFile(self):

    message = 'another    unique    message'
    category = FakeWarning
    filename = 'warning-filename.py'
    lineno = 31
    output = StringIO()
    log.showwarning(message, category, filename, lineno, file=output)
    self.assertEqual(output.getvalue(), warnings.formatwarning(message, category, filename, lineno))
    line = 'hello    world'
    output = StringIO()
    log.showwarning(message, category, filename, lineno, file=output, line=line)
    self.assertEqual(output.getvalue(), warnings.formatwarning(message, category, filename, lineno, line))
