PyCharm 2.7.2 Web Help

2.5+

Code Coverage shows how much of your code is covered with tests and marks covered and uncovered lines visually right in the editor.

In this section:

Prerequisites

Note

  1. The JSTestDriver plugin is installed and enabled.

    The plugin is not bundled with PyCharm, but it is available from the PyCharm plugin repository. Once enabled, the plugin is available at the IDE level, that is, you can use it in all your PyCharm projects.

  2. Additional third-party testing frameworks, for example, Jasmine or QUnit, are downloaded and integrated with PyCharm.
To measure code coverage
  1. Prepare tests manually or have tests generated by PyCharm.
  2. Create a test runner configuration file.
  3. Create a run configuration of the type JSTestDriver.

    To have specific files excluded from coverage analysis, specify the paths to them in the Coverage tab of the Run/Debug Configuration: JSTestDriver dialog box.

  4. Start the JSTestDriver server and capture a browser to run the tests in.
  5. On the main toolbar, select the JSTestDriver run configuration in the Run/Debug Configurations drop-down list and click the Run with Coverage button runWithCoverage.
  6. Monitor the code coverage in the Coverage tool window.

See Also

Procedures:

Reference:

Web Resources: