title: PyTest Suppress Results Debug Statement
body: <p>I am using PyTest with the following options: <code>-s</code>, <code>-v</code>, and <code>--resultlog=results.txt</code>. This suppresses print statements from my test, but prints the test names and results as they are run and logs the results to <code>results.txt</code>.</p>
  
  <p>However, if any tests fail, I also get a spew of information containing traceback, debug, etc. Since I am logging this to a file anyway, I don't want it printed to the screen, cluttering up my output.</p>
  
  <p>Is there any way to disable the printing of just these debug statements, but still have it logged to my results file?</p>
  
  <p><strong>Visual example:</strong></p>
  
  <p>Currently, I see something like this:</p>
  
  <pre><code>$ py.test -sv --resultlog=results.txt test.py
  =============================== test session starts =========================
  platform darwin -- Python 2.7.10, pytest-2.9.1, py-1.4.31, pluggy-0.3.1 -- /...
  cachedir: .cache
  rootdir: /Users/jdinkel/Documents, inifile:
  plugins: profiling-1.1.1, session2file-0.1.9
  collected 3 items
  
  test.py::TestClass::test1 PASSED
  test.py::TestClass::test2 PASSED
  test.py::TestClass::test3 FAILED
  
  ===================================== FAILURES ==============================
  __________________________________ TestClass.test3 __________________________
  self = &lt;test.TestClass instance at 0x10beb5320&gt;
  
      def test3(self):
  &gt;     assert 0
  E     assert 0
  
  test.py:7: AssertionError
  ========================== 1 failed, 2 passed in 0.01 seconds ===============
  </code></pre>
  
  <p>But I would like to see this:</p>
  
  <pre><code>$ py.test -sv --resultlog=results.txt test.py
  =============================== test session starts =========================
  platform darwin -- Python 2.7.10, pytest-2.9.1, py-1.4.31, pluggy-0.3.1 -- /...
  cachedir: .cache
  rootdir: /Users/jdinkel/Documents, inifile:
  plugins: profiling-1.1.1, session2file-0.1.9
  collected 3 items
  
  test.py::TestClass::test1 PASSED
  test.py::TestClass::test2 PASSED
  test.py::TestClass::test3 FAILED
  
  ========================== 1 failed, 2 passed in 0.01 seconds ===============
  </code></pre>
  
  <p>With no change to the <code>results.txt</code> file.</p>