Commit 93232660 authored by Michael Foord's avatar Michael Foord

Another attempt at a fix for unittest.test.test_result for windows line endings

parent 9b4ee12e
import os
import sys
import textwrap
from cStringIO import StringIO, OutputType
......@@ -414,8 +413,8 @@ class TestOutputBuffering(unittest.TestCase):
print 'foo'
print >> sys.stderr, 'bar'
self.assertEqual(out_stream.getvalue(), 'foo%s' % os.linesep)
self.assertEqual(err_stream.getvalue(), 'bar%s' % os.linesep)
self.assertEqual(out_stream.getvalue(), 'foo\n')
self.assertEqual(err_stream.getvalue(), 'bar\n')
self.assertEqual(result._original_stdout.getvalue(), '')
self.assertEqual(result._original_stderr.getvalue(), '')
......@@ -468,13 +467,13 @@ class TestOutputBuffering(unittest.TestCase):
expectedOutMessage = textwrap.dedent("""
Stdout:
foo
""").replace('\n', os.linesep)
""")
expectedErrMessage = ''
if include_error:
expectedErrMessage = textwrap.dedent("""
Stderr:
bar
""").replace('\n', os.linesep)
""")
expectedFullMessage = 'None\n%s%s' % (expectedOutMessage, expectedErrMessage)
self.assertIs(test, self)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment