coverage.py does not cover script if py.test executes it from another directory

I encountered the same issue when calling “py.test –cov …” from tox. I found a hint on this page: http://blog.ionelmc.ro/2014/05/25/python-packaging/ even though it does not mention this explicitly. Using “–develop” for tox will make sure that coverage data gathering is called from the same directory as coverage analysis. This section in tox.ini made it work … Read more

Using py.test with coverage doesn’t include imports

@hynekcer gave me the right idea. But basically the easiest solution lies somewhere else: Get rid of pytest-cov! Use coverage run –source jedi -m py.test coverage report instead!!! This way you’re just running a coverage on your current py.test configuration, which works perfectly fine! It’s also philosophically the right way to go: Make each program … Read more