scverse_backends.testing.run_conformance

scverse_backends.testing.run_conformance#

scverse_backends.testing.run_conformance(*, backend_name, tests, get_backend, functions=None, raise_on_failure=True)[source]#

Run host-supplied feedback checks against a backend.

Parameters:
backend_name str

Name or alias of the backend to test.

tests dict[str, Callable[[str], None]]

Mapping {function_name: test_callable}. The callable receives the backend name and is expected to assert behavior internally (e.g. via np.testing.assert_allclose).

get_backend Callable[[str], Any | None]

The host’s get_backend function (typically dispatcher.get_backend). Used to resolve aliases and to skip tests for functions the backend doesn’t implement.

functions Sequence[str] | None, default: None

Restrict the run to specific function names. None runs every test.

raise_on_failure bool, default: True

If True (default), re-raise the first test failure after recording it.

Return type:

dict[str, str]

Returns:

Dict mapping function name to "PASSED", "SKIPPED (...)", or "FAILED: ...".