title: How can I make Python's coverage tool fail if any unit tests fail?
body: <p>I want to use a shell script to make sure that my unit tests pass <strong>and</strong> that my code has sufficient test coverage.  I only want to run my test code <strong>once</strong>.</p>
  
  <p>I was hoping that I could run my tests via the <a href="https://coverage.readthedocs.io/" rel="nofollow noreferrer">coverage</a> tool and that from that single run:</p>
  
  <ol>
  <li>If one or more tests failed, the 'coverage run' command would fail, which would communicate to my shell script that something went wrong.</li>
  <li>Or if the coverage was insufficient, the 'coverage run' command would fail (using --fail-under).</li>
  </ol>
  
  <p>How would you do that without redirecting command output and searching for key words (e.g. fail)?</p>