Skip to content

problem with coverage stats when using multiprocessing #209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
franklingu opened this issue Jun 18, 2018 · 3 comments
Open

problem with coverage stats when using multiprocessing #209

franklingu opened this issue Jun 18, 2018 · 3 comments

Comments

@franklingu
Copy link

I am using multiprocessing.Process in some file. When I run test just for that file, seems the coverage data is OK.

py.test --cov=data_utils --cov-report=html -vv -s  tests/test_utils_multiprocessing.py

And data:

Coverage for data_utils/utils/_multiprocessing.py : 95% Show keyboard shortcuts
85 statements 81 run 4 missing 0 excluded

But when I run test for whole tests directory the coverage for _multiprocessing.py and tests run after that dropped a lot -- compared to when being run in single file.

py.test --cov=data_utils --cov-report=html -vv -s

Coverage for data_utils/utils/_multiprocessing.py : 47% Show keyboard shortcuts
85 statements 40 run 45 missing 0 excluded

I am using Python 3.6.1 and pytest==3.4.2, pytest-cov==2.5.1,pytest-forked==0.2,pytest-mock==1.7.1 on ubuntu 16.04. I looked at #139 and I think this is not the same issue. The coverage is OK if run single test file but is too low if run the whole directory

@haroune-mohammedi
Copy link

I'm having a similar issue with multiprocessing support, have you fixed yours @franklingu ?

@ionelmc
Copy link
Member

ionelmc commented Nov 30, 2022

Multiprocessing support was completely removed. See https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst#400-2022-09-28 for migration path to coveragepy's builtin mp support.

@thomascousindech
Copy link

Sorry to reopen an old topic, but rather than being explained in the CHANGELOG, shouldn't the documentation be updated with the proposed fix? At the moment, the documentation is confusing as it still looks like multiprocessing is handled, even though it's not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants