3

At the moment, I have 32% coverage of my library when testing my code using coverage, due to coverage, measuring coverage of e.g. numpy, scipy, and other imported Python libraries. The command I am using is

coverage run -m pytest -v tests/

Is there a way to exclude running test coverage for imported packages?

Thank you for your help.

1 Answer 1

2

Found the solution through the --source option in coverage:

coverage run --source ./ -m pytest -v tests/

where ./ is the current and only directory I want to include in the report.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.