title: Gather Pytest Exit Code
body: <p>I want to gather the pytest exit code (or some other way of finding out whether the test failed to passed), but using pytest.ExitCode does not do what I thought it would. Here is a small example I wrote up to better show what I want:</p>
  <pre class="lang-py prettyprint-override"><code>import pytest
  
  def test_hg_security():
      pass
  
  print(pytest.ExitCode)
  </code></pre>
  <p>The goal here is to use this to check if a test failed, then add logs if it did.</p>