title: Run coverage on tests directory via Travis-CI
body: <p>I am unable to run coverage.py in the tests directory from a Python project. I have a tests directory containing an <code>__init__.py</code> file and some <code>test_*.py</code> files where I define the tests I want to run in the <code>__main__</code> block of every test file. </p>
  
  <p>The tests directory is located in the same folder as the <code>.travis.yml</code> file which looks like:</p>
  
  <p><a href="https://i.stack.imgur.com/0qAJJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0qAJJ.png" alt="enter image description here"></a></p>
  
  <p>The <strong>script</strong> block works when I run a single file as <code>coverage run tests/test_errors.py</code>, but whenever I try to run all the files in the directory it does not work.</p>
  
  <p>I have tried the following solutions:</p>
  
  <ul>
  <li><p><a href="https://stackoverflow.com/questions/51662884/how-can-pytest-cov-report-coverage-of-python-code-that-is-executed-as-a-result-o/51663154#51663154">How can pytest-cov report coverage of python code that is executed as a result of pexpect.spawn?</a> => which did not work for me as Travis-CI debugger said there was no data to combine, and this solution is not excatly what I am looking for, as the most efficient way is not to list all the test files, just the directory I guess.</p></li>
  <li><p><a href="https://stackoverflow.com/questions/46388443/python-coverage-running-more-than-1-test/46389204#46389204">Python coverage: running more than 1 test</a> => this solution works but the coverage just is made in the tests directory, and I want to test the coverage of the whole project in codecov. To clarify, codecov shows:
  <a href="https://i.stack.imgur.com/crCED.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/crCED.png" alt="enter image description here"></a></p></li>
  </ul>
  
  <p>Whenever I run the coverage for a single file, codecov outputs this:</p>
  
  <p><a href="https://i.stack.imgur.com/VnJMv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VnJMv.png" alt="enter image description here"></a></p>
  
  <p>Which is what I am looking for, but when it comes to testing multiple Python files contained in the tests directory. Because as you can see, that is the codecov output when <code>coverage run tests/test_investpy.py</code> not for the whole `tests/' directory.</p>
  
  <p>Any help or information is welcomed! An thank you in advance!</p>
  
  <p>(NOTE: for further information about the project structure you can check the project in <a href="https://github.com/alvarob96/investpy" rel="nofollow noreferrer">https://github.com/alvarob96/investpy</a> as it is an Open Source Project)</p>