How TestStand Handles Python Interpreter Session Closure

Updated Aug 29, 2025

Reported In

Software

  • TestStand

Issue Details

I understand that TestStand offers several interpreter session configuration options: GlobalPer ExecutionPer Thread, and Object Reference. I'm interested in learning how each of these sessions is terminated. Specifically, is the shutdown process automatically managed by TestStand, or are there scenarios where manual intervention is required? 
 

Solution

When configuring the Python Adapter in TestStand, you can choose how the Python interpreter is managed during execution. The available options are:

 

  • Global: The Interpreter session created has the same lifetime of the TestStand application. To close it without exiting the application, go to: File > Unload All Modules.
  • Per Execution: The Interpreter session created has the lifetime of the execution.
  • Per Thread: The Interpreter session created has the lifetime of the thread.

 

 

Additionally, you can override the adapter configuration at the step level using the Advanced Settings. This allows you to select an option called Object Reference, which uses an interpreter session referenced by a variable. This session also follows the lifetime of the execution, but you can programmatically close it by assigning Nothing to the variable holding the reference.