pytest-cov collects no data on Travis

I recently switched from nosetests to pytest and pytest-cov for one of my Python project (http://easydev-python.readthedocs.io).

Locally, everything seemed to work fine and once on Travis, all tests passed as expected.

Yet, before the coverage report, I noticed this warning:

 Coverage.py warning: No data was collected"

and more importantly, the final coverage reported was 0% !!

I later realised that one __init__.py file in the test/ directory was present locally but not in the github source code. After a commit, travis found the missing file and the coverage came back to normal.

So, this __init__.py seems important for pytest-cov

Please follow and like us:
This entry was posted in Python and tagged , , . Bookmark the permalink.

12 Responses to pytest-cov collects no data on Travis

Leave a Reply

Your email address will not be published. Required fields are marked *