IntelliJ IDEA 2023.1 Help

Choose your testing framework

  1. Open the Settings dialog (press Control+Alt+S), and under the node Tools, click the page Python Integrated Tools.

  2. On this page, click the Default Test Runner field.

  3. Choose the desired test runner:

    Selecting a test runner

    If the selected test runner is missing in the specified interpreter, the appropriate notification appears.

    Install the missing test runner

    Click the Fix button to download and install the corresponding framework.

By default, the suggested default test runner is unittest. However, you can redefine the default framework and change it to nosetest, pytest or TwistedTrial.

Change the default testing framework

  1. From the main menu, select File | New Project Setup | Settings for New Projects for Windows and Linux, or File | New Project Setup | Preferences for New Projects for macOS.

  2. Select Tools | Python Integrated Tools.

  3. In the Testing area, select the test runner that will be default for all newly created projects.

With the test runner selected, IntelliJ IDEA suggests the appropriate default run/debug configuration:

Suggested run/debug configuration for a test framework

If a user already has the testing run/debug configuration for a specific file and for a specific testing framework, then IntelliJ IDEA will launch this run/debug configuration, regardless of your chosen default test runner.

If a user opens any non-IntelliJ IDEA project that involves testing frameworks, IntelliJ IDEA will autodetect the required test runner and set it for the project.

Last modified: 09 June 2023