diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-03-20 23:28:52 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-03-20 23:28:52 (GMT) |
commit | 25871dac0091cf99e8e35271606b87898d9c4c45 (patch) | |
tree | 0805f90019dc5b90763be24f4e0ca2037e0188f8 /Lib/test | |
parent | cb342182ee47c3e2c743de50d81aad60f4eebefd (diff) | |
parent | e0daff1c61e323d2a39dd8241de67082d1f10fd7 (diff) | |
download | cpython-25871dac0091cf99e8e35271606b87898d9c4c45.zip cpython-25871dac0091cf99e8e35271606b87898d9c4c45.tar.gz cpython-25871dac0091cf99e8e35271606b87898d9c4c45.tar.bz2 |
Merge
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_os.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 77fcbaf..56be375 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -90,6 +90,25 @@ class FileTests(unittest.TestCase): self.assertEqual(fobj.read().splitlines(), [b"bacon", b"eggs", b"spam"]) + def write_windows_console(self, *args): + retcode = subprocess.call(args, + # use a new console to not flood the test output + creationflags=subprocess.CREATE_NEW_CONSOLE, + # use a shell to hide the console window (SW_HIDE) + shell=True) + self.assertEqual(retcode, 0) + + @unittest.skipUnless(sys.platform == 'win32', + 'test specific to the Windows console') + def test_write_windows_console(self): + # Issue #11395: the Windows console returns an error (12: not enough + # space error) on writing into stdout if stdout mode is binary and the + # length is greater than 66,000 bytes (or less, depending on heap + # usage). + code = "print('x' * 100000)" + self.write_windows_console(sys.executable, "-c", code) + self.write_windows_console(sys.executable, "-u", "-c", code) + class TemporaryFileTests(unittest.TestCase): def setUp(self): |