summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/test
diff options
context:
space:
mode:
authorMichael Foord <fuzzyman@voidspace.org.uk>2010-04-07 23:04:22 (GMT)
committerMichael Foord <fuzzyman@voidspace.org.uk>2010-04-07 23:04:22 (GMT)
commitf6ff26c486373dcb6c9ee2f4aae102202e89b722 (patch)
treecf9bae379f6535622a28b261b68e0291bfe38450 /Lib/unittest/test
parent9a39eccfe168a1ce86197aca0a5cd1de67aa1589 (diff)
downloadcpython-f6ff26c486373dcb6c9ee2f4aae102202e89b722.zip
cpython-f6ff26c486373dcb6c9ee2f4aae102202e89b722.tar.gz
cpython-f6ff26c486373dcb6c9ee2f4aae102202e89b722.tar.bz2
unittest.result.TestResult does not create its buffers until they're used. It uses StringIO not cStringIO. Issue 8333.
Diffstat (limited to 'Lib/unittest/test')
-rw-r--r--Lib/unittest/test/test_result.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/unittest/test/test_result.py b/Lib/unittest/test/test_result.py
index c02b8ef..57ac549 100644
--- a/Lib/unittest/test/test_result.py
+++ b/Lib/unittest/test/test_result.py
@@ -1,6 +1,6 @@
import sys
import textwrap
-from cStringIO import StringIO, OutputType
+from StringIO import StringIO
from test import test_support
import unittest
@@ -24,6 +24,8 @@ class Test_TestResult(unittest.TestCase):
self.assertEqual(len(result.failures), 0)
self.assertEqual(result.testsRun, 0)
self.assertEqual(result.shouldStop, False)
+ self.assertIsNone(result._stdout_buffer)
+ self.assertIsNone(result._stderr_buffer)
# "This method can be called to signal that the set of tests being
@@ -400,8 +402,8 @@ class TestOutputBuffering(unittest.TestCase):
self.assertIsNot(real_out, sys.stdout)
self.assertIsNot(real_err, sys.stderr)
- self.assertIsInstance(sys.stdout, OutputType)
- self.assertIsInstance(sys.stderr, OutputType)
+ self.assertIsInstance(sys.stdout, StringIO)
+ self.assertIsInstance(sys.stderr, StringIO)
self.assertIsNot(sys.stdout, sys.stderr)
out_stream = sys.stdout