PyCharm enables usage of the following testing frameworks:
- The desired framework is installed on your machine. Refer to the framework documentation for the installation details.
- The default test runner is selected (Settings/Preferences | Tools | Python Integrated Tools - Default test runner)
With the test runner selected, PyCharm suggests the appropriate default run/debug configuration:
Testing frameworks support
For each of the supported testing frameworks, PyCharm provides:
- Code completion, aware of the specific testing framework.
- Run/debug configurations.
- Ability to create tests .
- Ability to navigate between tests and test subjects.
- Ability to run tests from within the IDE, and view test results in the test runner UI . The test results are shown on the Test Runner tab of the Run tool window.
- Ability to run all tests or features in a directory, specific test classes, test cases or features, individual test methods or examples.
- Code inspections.
- In docstrings :
- PyCharm recognizes Python code, provides syntax highlighting, code completion and resolve, and Python inspections.
- Aibility to recognize Python code can be turned on or off.
doctestsare presented as separate files, PyCharm allows opening such files as reStructuredText files with
*.rstextension. Such files are marked with icon, and feature syntax highlighting.
Refer to the section Testing for the detailed description of the common testing procedures.