Skip to content

warning "Module x was never imported" when running with xdist #212

@anthrotype

Description

@anthrotype

If I install pytest-xdist plugin, and run pytest --cov with some -n number of parallel processes (even with -n 1), I get this warnings at the end:

Coverage.py warning: Module psautohint was never imported. (module-not-imported)
Coverage.py warning: No data was collected. (no-data-collected)

However, the data is collected, the .coverage.* data file is created, and a report is printed correctly despite the warnings.

If I run without passing the -n xdist option, so not in parallel, I don't get any such warnings.
Similarly I don't get those warning if I run coverage run -m pytest instead of pytest --cov.

I have a .coveragerc file in the root of the repository which contains this:

source = psautohint

[paths]
source =
    src/psautohint
    .tox/*/lib/python*/site-packages/psautohint
    .tox/*/lib/site-packages/psautohint
    .tox/pypy*/site-packages/psautohint

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions