PyCharm 2023.2 Help

Viewing code coverage results

Viewing code coverage helps you detect pieces of your source code that are not affected by simulation.

View code coverage results

  1. Do one of the following:

  2. View coverage results:

  3. Open in the editor the files you want to explore.

  4. Use the color indicators in the gutter to detect the uncovered lines of code.

    py_code_coverage
  5. To find out how many times a line has been hit, click the line in the gutter area.

    View coverage results in the editor

    The popup that opens shows the statistic for the line at caret. For lines with conditions, the popup also provides statistics:

    Information on the branch

    Use the following toolbar buttons:

    • The Previous button the Next button: jump to the next/previous groups of covered or uncovered lines.

    • the Edit Coverage Colors button: open the Color Scheme settings, where you have to choose the node Line Coverage.

  6. Create missing tests, as described in the section Create tests Creating JavaScript Unit Tests.

    For JavaScript, tests can be generated as described in the Creating JavaScript Unit Tests section.

Last modified: 07 September 2023