Skip to content

"Module already imported so cannot be rewritten" warning with COV_CORE_SOURCE #211

@blueyed

Description

@blueyed

I am using the following in pytest-django's tox.ini (via the suggestion in pytest-dev/pytest-django#412 (comment)):

COV_CORE_SOURCE={toxinidir}
COV_CORE_CONFIG={toxinidir}/.coveragerc
COV_CORE_DATAFILE={toxinidir}/.coverage.eager

However, this requires to unset COV_CORE_SOURCE for the inner test runs
(which uses runpytest_subprocess).

I've noticed this because of a warning from pytest:

Module already imported so cannot be rewritten: pytest_cov

This warning however is still triggered by the outer pytest.

It makes sense, but I wonder if there is a better way to load pytest-cov eagerly by now (mentioned in the thread with #412), or if I should just configure the outer pytest to ignore this warning?

Related issue #148.

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