Closed truth-quark closed 4 years ago
I recommend using pytest-cov
instead of coverage.py manually.
pip install it and see if this works better:
pytest --cov insar tests insar
Interesting... the coverage docs recommended using coverage manually. pytest-cov
reports > 0% test coverage on both Gadi and my laptop, so it's doing something differently.
pytest does some magic bytecode rewriting, which might be messing it up... not sure!
Using pytest-cov solves this problem.
Coverage.py is reporting 0% statement execution for unit tested modules, both on Gadi and my local system.
The modules are being run, confirmed by adding raising an exception in the module code, which causes the tests to break. Below is an example of reproducing the issue on
Gadi
(coverage v4.5.4).Running the tests with a single module arg to pytest (
pytest -m tests/test_process_ifg.py
) also results in 0% coverage.My local virtual environment has coverage 5.2.1 & exhibits the same behaviour.
Hypotheses as to the source of the problem: