pyats.aetest.executer package

pyats.aetest.executer.change_to(executer)

Submodules

class pyats.aetest.executer.implementation.Executer(uids=None, groups=None, pdb=False, max_failures=None)

Bases: object

Built in object __init__

Creates and stores the default values for this executer instance.

Notes

The executer instance should be a singleton that is global to the current process. Everything instantiated for this singleton should be part of the __init__ procedure. Eg, upon resets, these variables do not change.

Parameters:
  • (callable) (groups) – check if that uid should be run.

  • (callable) – execution group to see if that testcase should run.

  • (bool) (pdb) –

  • (int) (max_failures) – aborting script run

bouncer(section)

Bouncer

Doorman function, checks each section to see if should be executed or not by running its uid as input to uids/groups feature input.

Parameters:

(obj) (section) –

Returns:

  • True if section is to be bounced (not on the list)

  • False otherwise (e.g. should be executed)

execute(section)

Execute

The main function of each executer implementation. Performs all the work necessary to run a given section object:

  • uids/groups check

  • error handling

  • goto handling

  • result assignment

Note that during execution, this function is called multiple times in in the linear stack. Eg: testcase is executed by it, then within that, testcase sections are also executed. Consider this as part of your design, as self.x variable changes affect all calls.

Parameters:

(obj) (section) –

Return type:

result (obj) of current executed section

goner(section)
property groups

groups

executer groups, returns the callable controlling the testcase groups to be executed as part of this script run.

Type:

property

log_result_reason(result)
reset()

Reset functionality

Resets all internal variables/content to their defaults. Consider this function as what’s needed to “reset” the executer to its initial state.

Note

only variables that are used during runtime of an executer should be reset. Those other ones that dictate the behavior of the executer (eg, those set during __init__) should not be reset.

signal_processor(signal)
track_execution_stack()

Maintains a stack of currently executing objects. This is a decorator function to execute().

Parameters:

(obj) (function) –

Return type:

decorated function

property uids

uids

executer uids, returns the callable controlling the section uids to be executed as part of this script run.

Type:

property

class pyats.aetest.executer.implementation.ExecuterStack(iterable=(), /)

Bases: list

property types
property uids