You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Coverage supports excluding coverage on branches and on function decorators. Alone these features work, but together they cause a leak of the exclusion into the outer indentation, excluding everything up to the next branch. See the minimal example.
To Reproduce
What version of Python are you using?
Python 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)] on win32
Python versions 3.8 and later tested with CI.
What version of coverage.py shows the problem? The output of coverage debug sys is helpful.
coverage_version: 7.2.6
What versions of what packages do you have installed? The output of pip freeze is helpful.
$ pip freeze
coverage==7.2.6
What code shows the problem? Give us a specific commit of a specific repo that we can check out. If you've already worked around the problem, please provide a commit before that fix.
What commands should we run to reproduce the problem? Be specific. Include everything, even git clone, pip install, and so on. Explain like we're five!
With the above two files in the working directory:
coverage run sample.py
coverage html
Expected behavior
Excluded branches should overlap without covering areas outside of either.
Additional context
I can workaround this issue if I remove @overload from the excludes and exclude ... instead, this excludes everything I want:
Describe the bug
Coverage supports excluding coverage on branches and on function decorators. Alone these features work, but together they cause a leak of the exclusion into the outer indentation, excluding everything up to the next branch. See the minimal example.
To Reproduce
Python versions 3.8 and later tested with CI.
coverage debug sys
is helpful.coverage_version: 7.2.6
pip freeze
is helpful.Real example of affected code, the exclusion leaks to the entire class below:
https://github.com/HexDecimal/python-tcod-ecs/blob/cb0ad6a3b562ceb68a8596d6fd1564b2b3ca8de2/tcod/ecs/__init__.py#L248-L262
Issue visible in Codecov:
https://app.codecov.io/gh/HexDecimal/python-tcod-ecs/commit/cb0ad6a3b562ceb68a8596d6fd1564b2b3ca8de2/blob/tcod/ecs/__init__.py#L248
Minimal example:
git clone
,pip install
, and so on. Explain like we're five!With the above two files in the working directory:
Expected behavior
Excluded branches should overlap without covering areas outside of either.
Additional context
I can workaround this issue if I remove
@overload
from the excludes and exclude...
instead, this excludes everything I want:The text was updated successfully, but these errors were encountered: