[svn r38104] fixing this so "py.test -s" passes on this as well
--HG-- branch : trunk
This commit is contained in:
parent
5b188f1167
commit
47aea3ca7b
|
@ -33,13 +33,12 @@ For calling functions you may use a shortcut:
|
||||||
:api:`py.io.StdCaptureFD`
|
:api:`py.io.StdCaptureFD`
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
If you also want to capture writes to the stdout/stdin
|
If you also want to capture writes to the stdout/stderr
|
||||||
filedescriptors you may invoke:
|
filedescriptors you may invoke:
|
||||||
|
|
||||||
>>> import py, sys
|
>>> import py, sys
|
||||||
>>> capture = py.io.StdCaptureFD()
|
>>> capture = py.io.StdCaptureFD()
|
||||||
>>> sys.stdout.write("hello")
|
|
||||||
>>> sys.stderr.write("world")
|
>>> sys.stderr.write("world")
|
||||||
>>> out,err = capture.reset()
|
>>> out,err = capture.reset()
|
||||||
>>> out.strip() + err.strip() == "helloworld"
|
>>> err
|
||||||
True
|
'world'
|
||||||
|
|
Loading…
Reference in New Issue