This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ezio.melotti
Recipients benjamin.peterson, eric.araujo, ezio.melotti, mark.dickinson, python-dev, terry.reedy
Date 2013-03-09.22:44:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1362869084.96.0.441394667828.issue11963@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2013-03-09 22:44:45ezio.melottisetrecipients: + ezio.melotti, terry.reedy, mark.dickinson, benjamin.peterson, eric.araujo, python-dev
2013-03-09 22:44:44ezio.melottisetmessageid: <1362869084.96.0.441394667828.issue11963@psf.upfronthosting.co.za>
2013-03-09 22:44:44ezio.melottilinkissue11963 messages
2013-03-09 22:44:44ezio.melotticreate