title: How to access the py.test capsys from inside a test?
body: <p>py.test documentations says that I should add capsys parameter to my test methods but in my case this doesn't seem to be possible.</p>
  
  <pre><code>class testAll(unittest.TestCase):
  
      def setUp(self):
          self.cwd = os.path.abspath(os.path.split(inspect.getfile(inspect.currentframe()))[0])
          os.chdir(self.cwd)
  
      def execute(self, cmd, result=0):
          """
          Helper method used by many other tests, that would prevent replicating too much code.
          """
          # cmd = "%s &gt; /dev/null 2&gt;&amp;1" % cmd
          ret = os.system(cmd) &gt;&gt; 8
          self.assertEqual(ret, result, "`%s` returned %s instead of %s (cws=%s)\n\t%s" % (cmd, ret, result, os.getcwd(), OUTPUT)) ### &lt;&lt; how to access the output from here
  
      def test_1(self):
          self.execute("do someting", 0) 
  </code></pre>