Fix tests on Windows

This commit is contained in:
Manuel Jacob 2020-06-20 18:37:23 +02:00
parent a2fd4af7b5
commit df03cbb732
1 changed files with 2 additions and 1 deletions

View File

@ -901,7 +901,8 @@ class WarningsDisplayTests(BaseTest):
self.assertEqual(expect, file_object.getvalue())
# Test that file is flushed after writing the warning.
raw = BytesIO()
file_object = TextIOWrapper(BufferedWriter(raw), 'utf-8')
file_object = TextIOWrapper(BufferedWriter(raw), 'utf-8',
newline='')
expect = self.module.formatwarning(message, category, file_name,
line_num)
self.module.showwarning(message, category, file_name, line_num,