Test Run Class

TestRun is a high-level context manager class which initializes and closes data logging sessions. Arguments can be provided directly to the TestRun constructor.

TestRun can be used using the with statement as shown below:

with TestRun(
    metadata=METADATA,
    folder_path=os.path.join(os.getcwd(), "Data Logs"),
    file_name="Validation Data Log"
) as run:
...

TestRun can also be used without the with statement. However, in this case the close_datalog() statement must be called to commit the data to disk:

run = TestRun(
    metadata=METADATA,
    folder_path=os.path.join(os.getcwd(), "Data Logs"),
    file_name="Validation Data Log"
)
...
run.close_datalog()
Table 1. Python Test Run Class Parameters
Parameter Required? Data Type Description
metadata No Dictionary [Field, String] File-level metadata.
folder_path Yes String Folder path to the data log files.
file_name No String Name of the data log file. If file_name is not provided, the Field.ProductName metadata key is required. By default, the file name is set to: Validation_<ProductName>_<Timestamp>.csv