Show More
@@ -26,6 +26,7 b' import nose.tools as nt' | |||||
26 | from IPython.utils.process import (find_cmd, FindCmdError, arg_split, |
|
26 | from IPython.utils.process import (find_cmd, FindCmdError, arg_split, | |
27 | system, getoutput, getoutputerror, |
|
27 | system, getoutput, getoutputerror, | |
28 | get_output_error_code) |
|
28 | get_output_error_code) | |
|
29 | from IPython.utils.capture import capture_output | |||
29 | from IPython.testing import decorators as dec |
|
30 | from IPython.testing import decorators as dec | |
30 | from IPython.testing import tools as tt |
|
31 | from IPython.testing import tools as tt | |
31 |
|
32 | |||
@@ -149,6 +150,16 b' class SubProcessTestCase(tt.TempFileMixin):' | |||||
149 | status, 0, "The process wasn't interrupted. Status: %s" % (status,) |
|
150 | status, 0, "The process wasn't interrupted. Status: %s" % (status,) | |
150 | ) |
|
151 | ) | |
151 |
|
152 | |||
|
153 | def test_stderr_while_stdout_open(self): | |||
|
154 | """ | |||
|
155 | If lots of data is written to stderr while stdout is still open, enough | |||
|
156 | data to fill the pipe buffer in fact, the process still exits (i.e. | |||
|
157 | there is no deadlock). | |||
|
158 | """ | |||
|
159 | with capture_output(display=False): | |||
|
160 | system(("%s -c 'import sys\nfor i in range(2000): " + | |||
|
161 | "sys.stderr.write(\" \" * 100 + \"\\n\")'") % (python,)) | |||
|
162 | ||||
152 | def test_getoutput(self): |
|
163 | def test_getoutput(self): | |
153 | out = getoutput('%s "%s"' % (python, self.fname)) |
|
164 | out = getoutput('%s "%s"' % (python, self.fname)) | |
154 | # we can't rely on the order the line buffered streams are flushed |
|
165 | # we can't rely on the order the line buffered streams are flushed |
General Comments 0
You need to be logged in to leave comments.
Login now