'Test that the ExceptionReporter supports Unix, Windows and Macintosh EOL markers'

def test_eol_support(self):

    LINES = list(((u'print    %d' % i) for i in range(1, 6)))
    reporter = ExceptionReporter(None, None, None, None)
    for newline in [u'\n', u'\r\n', u'\r']:
        (fd, filename) = mkstemp(text=False)
        os.write(fd, force_bytes((newline.join(LINES) + newline)))
        os.close(fd)
        try:
            self.assertEqual(reporter._get_lines_from_file(filename, 3, 2), (1, LINES[1:3], LINES[3], LINES[4:]))
        finally:
            os.unlink(filename)
