Skip to main content

infrahub_sdk.pytest_plugin.items.base

Classes

InfrahubItem

Methods:

validate_resource_config

validate_resource_config(self) -> None

Make sure that a test resource config is properly defined.

get_result_differences

get_result_differences(self, computed: Any) -> str | None

Compute the differences between the computed result and the expected one.

If the results are not JSON parsable, this method must be redefined to handle them.

runtest

runtest(self) -> None

Run the test logic.

repr_failure

repr_failure(self, excinfo: pytest.ExceptionInfo, style: str | None = None) -> str

reportinfo

reportinfo(self) -> tuple[Path | str, int | None, str]

repository_base

repository_base(self) -> str

Return the path to the root of the repository

This will be an absolute path if --infrahub-config-path is an absolute path as happens when tests are started from within Infrahub server.