4

My Python project in PyCharm is not showing the run with coverage option. I am using the community edition.

enter image description here

I am using a workaround with some commands like

coverage run --source=./src/processor -m unittest discover -s src/ && coverage report

This gives me the code coverage report but it does not show which line is not covered by the test case.

I want to know if this is a known issue or it is a paid feature. Is there a way to view the uncovered lines?

bad_coder
  • 11,289
  • 20
  • 44
  • 72
Abhishek Patil
  • 1,373
  • 3
  • 30
  • 62
  • 1
    I just checked and this question is not a duplicate. It's a legitimate question since SO users are likely to search for this info here before going to the JetBrains documentation. I had this same question when I was using Community Edition. – bad_coder Apr 19 '21 at 05:41
  • I believe that this is in fact a duplicate as the answer is embedded already in this previous question: https://stackoverflow.com/questions/57767350/pycharm-coverage-in-community-edition. Here alternatives are provided for coverage – astrochun Apr 19 '21 at 06:08
  • @astrochun I hadn't found that thread although I have answered [one of guettli's questions before](https://stackoverflow.com/questions/65517274). In any case, the questions are textually different (the name of the button doesn't give a hit in search for the other thread). And while the other question is about seeing coverage results in the IDE, this one is about why there isn't any coverage in community edition. – bad_coder Apr 19 '21 at 06:15

1 Answers1

3

Running coverage integrated in the PyCharm IDE is a feature exclusive to the Professional edition. It's stated at the top of the documentation Running with coverage and can also be verified in the edition comparison matrix.

However, you can still generate coverage HTML reports from the terminal and see the results. Although less convenient since you don't get the integrated run button and the red/green lines in the editor window sidebar, it's still possible to have the coverage functionalities.

bad_coder
  • 11,289
  • 20
  • 44
  • 72