summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_mailbox.py
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-03-26 19:49:26 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-03-26 19:49:26 (GMT)
commit9edef04c956c36aaa3ccc3eaef2d99f233153297 (patch)
treeaad4f8f586d31cb8cffaaefaefb9aaf0a9e25e8c /Lib/test/test_mailbox.py
parentf6cd967e2c204238cb4fe56c7e842cf7766ddd01 (diff)
downloadcpython-9edef04c956c36aaa3ccc3eaef2d99f233153297.zip
cpython-9edef04c956c36aaa3ccc3eaef2d99f233153297.tar.gz
cpython-9edef04c956c36aaa3ccc3eaef2d99f233153297.tar.bz2
Correct Issue#1561: test_mailbox failed on Windows.
Open all text files with newline='', this is the only way to have consistent offsets.
Diffstat (limited to 'Lib/test/test_mailbox.py')
-rw-r--r--Lib/test/test_mailbox.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py
index 8f4b486..ca87229 100644
--- a/Lib/test/test_mailbox.py
+++ b/Lib/test/test_mailbox.py
@@ -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):