Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to exclude external packages from coverage report when using coverage.py API ? #1745

Open
AkashKumar7902 opened this issue Feb 7, 2024 · 1 comment
Labels
question Further information is requested support A support question from a user

Comments

@AkashKumar7902
Copy link

when I use coverage.py API, it includes the coverage report for the external packages too.

For example:

    /usr/lib/python3/dist-packages/yaml/reader.py:
    - 135
    - 139
    - 140
    - 147
    - 148

I don't want to include external packages in my coverage report.

@AkashKumar7902 AkashKumar7902 added bug Something isn't working needs triage labels Feb 7, 2024
@AkashKumar7902 AkashKumar7902 reopened this Feb 7, 2024
@nedbat
Copy link
Owner

nedbat commented Feb 7, 2024

The usual way to do this is to use the --source= option to limit coverage.py's focus to your own directory: https://coverage.readthedocs.io/en/7.4.1/source.html#execution

@nedbat nedbat added question Further information is requested support A support question from a user and removed bug Something isn't working needs triage labels Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested support A support question from a user
Projects
None yet
Development

No branches or pull requests

2 participants