Ezio Melotti added the comment:

> Putting another layer of indirection with script_helper could obfuscate 
> it to the point of making it unreadable (what stdout are we talking 
> about?  It’s a subprocess in a subprocess in a test).

The attached patch does this.  The basic idea for test_stdout_none is that the 
subprocess inherits the stdout of the parent if stdout=None.
If the test launches a subprocess with stdout=None, the subprocess will print 
on the test's stdout.  This is what currently happens, and that's why you see 
"this bit of output is from a test of stdout in a different process" while 
running test_subprocess.  If we add another layer, we have the test that 
launches a subprocess (parent), that in turn launches another subprocess 
(child).  The child process inherits the stdout of the parent process, and 
prints on it, and the test can then check the value of the parent stdout.

For test_stdout_filedes_of_stdout I used the same method, and everything seems 
to work fine.

----------
versions: +Python 2.7, Python 3.2, Python 3.4
Added file: http://bugs.python.org/file29359/issue11963.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11963>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to