bundle.testing.tools.assertions =============================== .. py:module:: bundle.testing.tools.assertions Attributes ---------- .. autoapisummary:: bundle.testing.tools.assertions.LOGGER Functions --------- .. autoapisummary:: bundle.testing.tools.assertions.instance_identity bundle.testing.tools.assertions.compare Module Contents --------------- .. py:data:: LOGGER .. py:function:: instance_identity(instance, class_type) Validates that an instance belongs to a specified class or a subclass thereof. Asserts that the first argument is an instance and not a class, and that it is an instance of the specified class or its subclass. :param instance: The object to check. :param class_type: The class to which the instance should belong. :raises AssertionError: If `instance` is a class or not an instance of `class_type` or its subclasses. .. py:function:: compare(ref: object, tmp: object) -> None Compares two objects for equality and generates a detailed string diff if they differ. Converts each object to a string and uses difflib to compare these string representations. If differences are found, an AssertionError is raised with a detailed diff. :param ref: The reference object to compare. :param tmp: The temporary object to compare against the reference. :raises AssertionError: If `ref` and `tmp` are not equal, with a detailed diff as the error message.