TestTask¶
from inet.test.task
- class TestTask(name='test', task_result_class=<class 'inet.test.task.TestTaskResult'>, **kwargs)[source]¶
Bases:
inet.common.task.Task
Represents a self-contained test task that can be run without additional parameters.
Initializes a new task object.
- Parameters
name (string) – A human readable short description of the task, usually a noun.
action (string) – A human readable short description of the operation the task is carrying out, usually a verb.
print_run_start_separately (bool) – Specifies if the start and end of the task’s execution is printed separately wrapping around the execution.
task_result_class (string) – The Python class name of the produced task result object.
Methods
Runs the task again.
Runs the task.
Attributes
- rerun(**kwargs)¶
Runs the task again.
- Returns (
TaskResult
): The task result.
- Returns (
- run(dry_run=False, keyboard_interrupt_handler=None, handle_exception=True, **kwargs)¶
Runs the task.
- Parameters
dry_run (bool) – Specifies to skip the actual running of the task but do everything else.
keyboard_interrupt_handler (
inet.common.KeyboardInterruptHandler
or None) – Provides a class that will handle keyboard interrupts. This allows seamless exit from running multiple tasks.handle_exception (bool) – Specifies if exceptions are caught and processed or passed to the caller.
- Returns (
TaskResult
): The task result.