Skip to content

--cov does not apply with source_pkgs #723

@kandji-gregg

Description

@kandji-gregg

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__.:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions