Easypy
Introduction
Easypy provides a standardized runtime environment for testscript execution in pyATS
It offers a simple, straight-forward way for users to aggregate testscripts together into jobs, integrates various pyATS modules together into a collectively managed ecosystem, and archives all resulting information for post-mortem debugging.
Installation
Easypy module easypy is installed by default as part of pyATS installation. The package is also featured in the PyPI server, and can be installed separately.
pip install pyats.easypy [--upgrade]
Jobfile and Tasks
In pyATS, the aggregation of multiple testscripts together and executed within the same runtime environment is called a job which corresponds to a jobfile
During runtime, these testscripts are launched as tasks and executed through a test harness (eg, aetest)
Jobfiles are required to satisfy the following criterion:
each job file must have a main() function defined. This is the main entry point of a job file run.
the main() function accepts an argument called runtime. When defined, the engine automatically passes the current runtime object in.
inside the main() function, use easypy.run() or easypy.Task() to define and run individual testscripts as Tasks.
the name of the job file, minus the .py extension, becomes this job’s reporting name. This can be modified by setting runtime.job.name attribute.
Example of jobfile:
Reference
Last updated