I have been adding type checking with MyPy to various python projects and I've found that doing so prevents Coverage from properly generating test coverage reports. Specifically it prevents coverage from overwriting it's htmlcov directory, it works as expected if I delete this directory before running coverage.
While MyPy and Coverage seem like they should be completely unrelated I have seen this behaviour in multiple projects, always after adding type checking.
I am using:
- python 3.9.6
- pytest 6.2.4
- pytest-cov 2.12.1
- coverage 5.5
- coveralls 3.2.0
- mypy 0.910
Coverage reports are generated with pytest.