pytest-cov icon indicating copy to clipboard operation
pytest-cov copied to clipboard

--cov does not apply with source_pkgs

Open kandji-gregg opened this issue 2 months ago • 0 comments

Summary

adding --cov does not work if source_pkgs is used instead of source in the .coveragerc file

Expected vs actual result

I expect adding --cov to narrow the results to the specified directories but it ignores it if source_pkgs is defined.

Reproducer

Versions

coverage 7.4.3 pytest-cov 4.0.0

Also tested on: coverage 7.11.0 pytest-cov 7.0.0

Config

[run]
branch = True
omit =
    */tests/*
    */test/*
    */types/*
    manage.py
    */management/commands/*
    venv/*
    */migrations/*
    */site-packages/*
    */fixtures/*
    */*urls.py

source_pkgs =
    admin
    agent
    api
    auth
    crypto
    dep
    developer
    enterprise_api
    integrations
    internal_api
    library
    log
    managed_library
    ota
    pki
    public
    rest
    rtc
    scep
    shared
    owleye_backend

[report]
omit =
    */tests/*
    */test/*
    */types/*
    manage.py
    */management/commands/*
    venv/*
    */migrations/*
    */site-packages/*
    */fixtures/*
    */*urls.py


exclude_lines =
    pragma: no cover
    def __repr__
    if self.debug:
    if settings.DEBUG
    raise AssertionError
    raise NotImplementedError
    if 0:
    if __name__ == .__main__.:

kandji-gregg avatar Oct 23 '25 15:10 kandji-gregg