JetBrains Fleet 1.48 Help

Python run configurations

This topic summarizes the run configurations available for Python. Each table provides keys that are available within a run configuration and their descriptions.

python

Runs Python scripts.

type

(required)

Specifies the configuration type

name

(required)

Specifies the configuration name displayed in the Run & Debug window

file

Either file or module is required

Specifies the path to the Python script to be executed

To execute a module, use module

module

Either module or file is required

Specifies the name of the module to be executed

To execute a Python script, use file

arguments

Specifies the arguments that will be passed to the script or module

environment

Custom environment variables for the process, specified as a JSON object. To define an environment variable, add a property where the key is the variable name and the value is its value. For example:

"environment": { "PYTHONUNBUFFERED": "1", "PYTHONWARNINGS": "ignore" }

dependsOn

Names of other configurations to run before this configuration. For example: "dependsOn": ["first", "second"]. For details, see Chained run configurations.

workingDir

Working directory for the run configuration.

allowParallelRun

If set to true, multiple instances of this configuration can run simultaneously.

Example

  • The following configuration runs script.py passing 60 as the argument:

    { "type": "python", "name": "run_script", "module": "script", "arguments": ["60"], }
Example of python configuration

python-tests

Runs Python tests by using either pytest or unittest testing framework.

type

(required)

Specifies the configuration type

name

(required)

Specifies the configuration name displayed in the Run & Debug window

testFramework

(required)

Specifies the testing framework. Possible values are:

  • pytest

  • unittest

targetType

Specifies the type of the targets parameter items. Possible values are:

  • module (default)

  • path

targets

(required)

Specifies the tests to be executed.

Depending on the value of targetType, the list can contain:

  • names of Python modules and test classes

  • paths to Python files and folders with tests

arguments

Lists the command-line options to be passed to the testing framework.

For the full list of available command-line options, refer to:

environment

Custom environment variables for the process, specified as a JSON object. To define an environment variable, add a property where the key is the variable name and the value is its value. For example:

"environment": { "PYTHONUNBUFFERED": "1", "PYTHONWARNINGS": "ignore" }

dependsOn

Names of other configurations to run before this configuration. For example: "dependsOn": ["first", "second"]. For details, see Chained run configurations.

workingDir

Working directory for the run configuration.

allowParallelRun

If set to true, multiple instances of this configuration can run simultaneously.

Examples

  • The following configuration uses pytest to run the tests in test_car.py and the tests directory. The -k not brake argument specifies that only the methods that don't contain "brake" in their names should be executed.

    { "type": "python-tests", "name": "pytest", "testFramework": "pytest", "targetType": "path", "targets": ["test_car.py", "tests"], "arguments": ["-k not brake"], }
    Example of pytest run configuration
  • The following configuration uses unittest to run the tests in tests/test_car.py. The --failfast argument specifies that the testing should be stopped on the first failure.

    { "type": "python-tests", "name": "unittest", "testFramework": "unittest", "targetType": "path", "targets": ["tests/test_car.py"], "arguments": ["--failfast"], }
    Example of pytest run configuration
22 May 2025