mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Correct Issue#1561: test_mailbox failed on Windows.
Open all text files with newline='', this is the only way to have consistent offsets.
This commit is contained in:
parent
f6cd967e2c
commit
9edef04c95
2 changed files with 18 additions and 19 deletions
|
|
@ -410,8 +410,7 @@ class TestMailbox(TestBase):
|
|||
_sample_message, io.StringIO(_sample_message)):
|
||||
output = io.StringIO()
|
||||
self._box._dump_message(input, output)
|
||||
self.assertEqual(output.getvalue(),
|
||||
_sample_message.replace('\n', os.linesep))
|
||||
self.assertEqual(output.getvalue(), _sample_message)
|
||||
output = io.StringIO()
|
||||
self.assertRaises(TypeError,
|
||||
lambda: self._box._dump_message(None, output))
|
||||
|
|
@ -757,7 +756,7 @@ class _TestMboxMMDF(TestMailbox):
|
|||
self._box._file.seek(0)
|
||||
contents = self._box._file.read()
|
||||
self._box.close()
|
||||
self.assertEqual(contents, open(self._path, 'r').read())
|
||||
self.assertEqual(contents, open(self._path, 'r', newline='').read())
|
||||
self._box = self._factory(self._path)
|
||||
|
||||
def test_lock_conflict(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue