Skip to content

Failing to omit files through setup.cfg #1558

Closed as not planned
Closed as not planned
@SebastienMorais

Description

@SebastienMorais

Describe the bug
In my setup.cfg file, I specify that i want to omit my test files when measuring coverage:

[coverage:run]
omit = *tests/*

While this worked a few version ago (at least in 6.5), current version (7.1.0) does not omit the tests files.
This can be fixed with the following setup

[coverage:run]
omit = my_package/tests/*

Although it is possible to make everything work (as specified), I am surprised that my previous configuration no longer works.

To Reproduce
I'm using python 3.8.14 with coverage 6.5 and pytest 7.2.1.
The command used is:
coverage run -m pytest --cov=my_package --cov-fail-under=95 --cov-config=setup.cfg

Expected behavior
I would expect that omit through *tests/* would omit every files contained in my_package/tests/

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsgood firstThis could be a good first contribution

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions