memote.suite.collect module

Collect results for reporting model quality.

class memote.suite.collect.ResultCollectionPlugin(model, repository=None, branch=None, commit=None, exclusive=None, skip=None, custom_config=None, **kwargs)[source]

Bases: object

Provide functionality for complex test result collection.

The plugin exposes the fixture store which can be used in test functions to store values in a dictionary. The dictionary is namespaced to the module so within a module the same keys should not be re-used (unless intended).

model(read_only_model)[source]

Provide a pristine model for a test unit.

pytest_namespace()[source]

Insert model information into the pytest namespace.

pytest_report_teststatus(report)[source]

Log pytest results for each test.

The categories are passed, failed, error, skipped and marked to fail.

Parameters:

report : TestReport

A test report object from pytest with test case result.

pytest_runtest_call(item)[source]

Either run a test exclusively or skip it.

pytest_runtest_teardown(item)[source]

Collect the annotation from each test case and store it.

read_only_model()[source]

Provide the model for the complete test session.

results

Return the test results as a nested dictionary.