eval_test_task – One task to evaluate them all

The purpose of this module is to define the EvalTestTask class, a task that evaluates a collection of Test objects and transforms them into TestResult objects, which can be subsequently processed for inclusion in a test report.

valjean.gavroche.eval_test_task.actually_eval_test(test)[source]

Actually perform test evaluation.

Returns:

the result of test evaluation.

Return type:

TestResult

Raises:

TestResultFailed – if the underlying test raises any exception.

class valjean.gavroche.eval_test_task.EvalTestTask(name, test_task_name, *, deps=None, soft_deps=None)[source]

Class that evaluates a list of tests and stores the resulting TestResult objects in the environment.

classmethod from_test_task(test_task, name=None)[source]

This method instantiates an EvalTestTask that will evaluate all the tests generated by a given task.

Parameters:

test_task (Task) – a task that is expected to generate a list of tests as a result.

__init__(name, test_task_name, *, deps=None, soft_deps=None)[source]

Direct instantiation of an EvalTestTask.

Parameters:
  • name (str) – the name of this task.

  • test_task_name (str) – the name of the task that generated the tests.

  • deps (list(Task) or None) – the list of dependencies for this task.

  • soft_deps (list(Task) or None) – the list of soft dependencies for this task.

valjean.gavroche.eval_test_task.evaluate_tests(test_fn, name=None)[source]

Create an EvalTestTask objects for the given test.

Parameters:
Returns:

the task that evaluates your tests.

Return type:

EvalTestTask