document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. \'\'\'
  2. http://pytest.org/2.2.4/capture.html
  3. \'\'\'
  4. def test_myoutput(capsys): # or use "capfd" for fd-level
  5.     print ("hello")
  6.     sys.stderr.write("world\\n")
  7.     out, err = capsys.readouterr()
  8.     assert out == "hello\\n"
  9.     assert err == "world\\n"
  10.     print "next"
  11.     out, err = capsys.readouterr()
  12.     assert out == "next\\n"
');