Closed zhuofeng6 closed 1 year ago
nobody respond? it is a bug?
I think we experienced the same thing. The coverage was lost from 3.0.0 to 4.0.0.
https://github.com/Whist-Team/Whist-Core/pull/247 https://github.com/Whist-Team/Whist-Server/pull/359
The test file is imported, not run as a script thus that if __name__ == "__main__"
branch can't be covered. It's not like it is run anyway. You're complaining that dead code isn't run.
@Segelzwerg you're using multiprocessing in your test suite, support for it was removed in pytest-cov 4. See the changelog for migration path: https://pytest-cov.readthedocs.io/en/latest/changelog.html
@Segelzwerg you're using multiprocessing in your test suite, support for it was removed in pytest-cov 4. See the changelog for migration path: https://pytest-cov.readthedocs.io/en/latest/changelog.html
@ionelmc thanks for the advice. I didn't realize it. Will investigate now!
test.py
run:
pytest --cov=./ test.py
output:
The normal coverage rate should be 100%. why 50%.