title: pytest capturing all output to stdout
body: <p>I test the 'current line' that's printed like this</p>
  
  <pre><code>def test_clear(capsys):
      out = capsys.readouterr()
      outputs_more_than_one_line()
      assert out.out == 'last line printed'
      # impossible to check previously printed lines?
  </code></pre>
  
  <p>However, I would like to check everything that was printed. I've considered monkeypatching <code>builtins.print</code>, but that doesn't seem robust (doesn't capture sys.write.stdout). Is there anyway this would be possible? </p>