Python Adapter Configuration Dialog Box
- Aktualisiert2025-07-21
- 2 Minute(n) Lesezeit
Python Adapter Configuration Dialog Box
Select Configure»Adapters to launch the Adapter Configuration dialog box. Select the Python adapter in the list control and click Configure . The Python Adapter Configuration dialog box contains the following options:
-
Interpreter to use
—Interpreter session to use for execution. It contains the following options:
- Global —All Python modules execute in a single instance of the Python interpreter.
- Per Execution —Each execution uses a separate instance of the Python interpreter to execute modules.
- Per Thread —Each thread uses a separate instance of the Python interpreter to execute modules.
- Display Console for Interpreter Sessions —Specifies whether to display a console window for the Python interpreter session when executing the Python module.
-
Virtual Environment
—Directory path of the virtual environment to use for executing the Python code module. Leave the field empty to use the default environment.
Note TestStand supports virtual environments created using the virtualenv or venv tool.
-
Reload Modified Modules Before Execution
—
If you enable this option prior to execution, TestStand will reload an updated Python module without unloading other modules or restarting TestStand execution. Immediately before executing the step, if TestStand determines that the configured module is modified, TestStand then reloads the module.
Note- Enable this option only in test development and debugging environments. In production environments, disable this option.
- TestStand reloads only the module which is directly called from the step.
- Reloading the module will re-initialize all global variables of the module.
- If you modify a module that defines a class and another module stores an instance of that class, TestStand does not reload the second module when it reloads the first one. You must reload the second module to discard any instances of the objects and create new instances.
- If any Python object such as a class instance exists, and you modify the object, you must recreate the class instance after reloading the module.
- Enable Debugging —Enables step into debugging operations when executing a Python module. You must install Visual Studio Code and configure your machine as described in Debugging Python Modules .
- Enable Just My Code —Specifies whether you want to debug installed libraries when you step into a Python code module.
-
Executable Path
—File path, including the file name
python.exe
, of the Python executable to use to perform step into operations when debugging Python modules.
Note In TestStand 2024 Q2 and subsequent versions, TestStand determines the executable path to use for stepping into Python modules.
- Version —Python version to use for executing the Python code module.
- Application Path —Location of the external application to use for viewing Python code modules.
-
Arguments
—Command line arguments to use when launching the Python module viewer application.
Note The string %ModulePath% is the placeholder that must be a part of the argument string. TestStand uses this placeholder to provide the external application with the path to the Python code module.