[IPython-dev] stdout when running the test suite

Robert Kern robert.kern at gmail.com
Sun Apr 24 20:16:26 EDT 2011


On 4/24/11 3:26 PM, MinRK wrote:
> This has been true for a *long* time - at least January 2010.  I did
> some checking, and it turns out that it's actually related to io.Term,
> so I pushed a fix to PR #397, since that's regarding the same code.
>
> The Term object created with the InteractiveShell latches onto
> sys.stdout before nose redirects it (which happens in every test), so
> anything printed there would still arrive at stdout.  I've fixed this
> in the tests, by creating simple StreamProxy objects that are soft
> links to sys.stdout/err, rather than hard ones, so the Capture plugin
> should still work with IPython output.

For what it's worth, I've had to do a similar thing in a non-test situation. It 
might be worthwhile to expose such a thing in io itself.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the IPython-dev mailing list