summaryrefslogtreecommitdiff
path: root/unit_tests/test_capture_plugin.py
diff options
context:
space:
mode:
authorJohn Szakmeister <john@szakmeister.net>2015-11-28 07:27:16 -0500
committerJohn Szakmeister <john@szakmeister.net>2015-11-28 07:27:16 -0500
commit729c99a68f63b09e3ea05ba9f0c1ce6d51d70018 (patch)
tree2ea7842b3175f501242f55db85518da99976fb28 /unit_tests/test_capture_plugin.py
parent5b02f5a32e5fb13471d497bfd635c328ac32f146 (diff)
parenta8723ecfcf74105db2caabf1d2a4c614fd942396 (diff)
downloadnose-729c99a68f63b09e3ea05ba9f0c1ce6d51d70018.tar.gz
Merge an amended version of #630.
Fake stdout should always have an encoding attribute.
Diffstat (limited to 'unit_tests/test_capture_plugin.py')
-rw-r--r--unit_tests/test_capture_plugin.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/unit_tests/test_capture_plugin.py b/unit_tests/test_capture_plugin.py
index 2f721f0..edab7de 100644
--- a/unit_tests/test_capture_plugin.py
+++ b/unit_tests/test_capture_plugin.py
@@ -96,5 +96,12 @@ class TestCapturePlugin(unittest.TestCase):
err = sys.exc_info()
formatted = c.formatError(d, err)
+ def test_captured_stdout_has_encoding_attribute(self):
+ c = Capture()
+ c.start()
+ self.assertNotEqual(sys.stdout, sys.__stdout__)
+ self.assertTrue(hasattr(sys.stdout, 'encoding'))
+ c.end()
+
if __name__ == '__main__':
unittest.main()