Skip to content

Module-level code imported from conftest files is reported as 'uncovered' #19

@carljm

Description

@carljm

This is because pytest-cov doesn't actually start coverage measurement until pytest_sessionstart.

I think it could perhaps be fixed by starting coverage measurement instead in pytest_load_initial_conftests, but a few things about this make me nervous:

  1. If people are setting up their coverage options via some method other than command-line args (e.g. modifying the config in another hook or plugin) it would no longer take effect soon enough.

  2. I'm not familiar with the distributed-coverage aspect of pytest-cov and cov-core, so I'm not sure what implications there might be there.

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