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:
- 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
.
- valjean.gavroche.eval_test_task.evaluate_tests(test_fn, name=None)[source]
Create an
EvalTestTask
objects for the given test.- Parameters:
test_fn (valjean.cosette.use.Use) – a function that produces tests, wrapped in a
Use
decorator.name (str) – the name of the
EvalTestTask
object.
- Returns:
the task that evaluates your tests.
- Return type: