bundle.testing.tools.decorators =============================== .. py:module:: bundle.testing.tools.decorators Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/bundle/testing/tools/decorators/cprofile/index /autoapi/bundle/testing/tools/decorators/data/index Functions --------- .. autoapisummary:: bundle.testing.tools.decorators.cprofile bundle.testing.tools.decorators.get_cprofile_enabled bundle.testing.tools.decorators.set_cprofile_enabled bundle.testing.tools.decorators.data Package Contents ---------------- .. py:function:: cprofile(expected_duration: int = EXPECTED_DURATION_NS, performance_threshold: int = PERFORMANCE_THRESHOLD_NS, cprofile_folder: pathlib.Path | None = None) -> collections.abc.Callable[[collections.abc.Callable[Ellipsis, Any]], collections.abc.Callable[Ellipsis, Any]] .. py:function:: get_cprofile_enabled() -> bool .. py:function:: set_cprofile_enabled(value: bool) -> None .. py:function:: data(tmp_dir: pathlib.Path, ref_dir: str | pathlib.Path, cprofile_folder: str | pathlib.Path | None = None) Decorator for testing bundle Data model serialization and schema validation. Wraps test functions to perform round-trip dict and JSON serialization tests, and validates the model against its JSON schema. Tests are profiled using cprofile. Results and errors are logged, with provision for updating reference data. :param tmp_dir: Temporary directory for test outputs. :type tmp_dir: Path :param ref_dir: Reference directory for baseline data. :type ref_dir: str | Path :param cprofile_folder: Directory for cprofile output. :type cprofile_folder: str | Path | None :returns: A decorator that wraps test functions to extend their functionality with serialization and validation tests. :rtype: Decorator