def test_newline(self):
    text = self.TEXT.decode('ascii')
    with self.open(self.filename, 'wt', encoding='utf-8', newline='\n') as f:
        f.write(text)
    with self.open(self.filename, 'rt', encoding='utf-8', newline='\r') as f:
        self.assertEqual(f.readlines(), [text])
def test_newline(self):
    text = self.TEXT.decode('ascii')
    with self.open(self.filename, 'wt', encoding='utf-8', newline='\n') as f:
        f.write(text)
    with self.open(self.filename, 'rt', encoding='utf-8', newline='\r') as f:
        self.assertEqual(f.readlines(), [text])