pytest DV Flow Extension

pytest-dfm is a DV Flow extension for the pytest testing framework. pytest-dfm allows unit tests to run tools encapsulated as DV Flow tasks and tasks graphs composed of those tasks. This is useful when developing tests for a DV-targeted Python package. Test and debug is most easily done in the context of Python (and pytest). However, artifacts created by running the packaging being tested need to be processed by tools available as DV Flow tasks. The pytest-dfm extension simplifies the task of using DV Flow Manager as a part of a pytest test suite.

dvflow Test Fixture

pytest uses fixtures to construct and provide services to tests. The pytest-dfm extension provides the dvflow fixture.

The dvflow fixture infers a temporary directory in which to run DV Flow tasks, and is a proxy for the DvFlow class.

class pytest_dfm.DvFlow(request: _pytest.fixtures.FixtureRequest, srcdir: str, tmpdir: str, builder: dv_flow.mgr.task_graph_builder.TaskGraphBuilder = None)

Bases: object

loadPkg(pkgfile)

Loads the specified flow.dv file as th root package

mkTask(task_t, name=None, srcdir=None, needs=None, **kwargs)

Creates a task of the specified type

runTask(task, listener=None, nproc=-1)

Executes the specified tree of task nodes