Search code examples
pycharmcoverage.pypytest-cov

How do I make PyCharm understand that certain files/directories are excluded from coverage?


How do I make PyCharm understand that certain files/directories are excluded from coverage, because right now it shows me "0% files, not covered" for directories like venv and tests.

Alt+Shift+F6, I select the .coverage file that only reports on files from the src/ directory, yet PyCharm shows me coverage for other files and directories as well. How do I fix this?


Solution

  • I found the solution. One needs to go to Settings -> Project: ... -> Project Structure, and set it up like this:

    enter image description here