def inspecting_handler() -> logging.Handler:
    """
    Fixture used to test the output of logger related output.
    """

    class InspectingHandler(logging.Handler):
        def __init__(self, *args, **kwargs) -> None:  # type: ignore[no-untyped-def]
            super().__init__(*args, **kwargs)
            self.messages = []  # type: ignore[var-annotated]

        def handle(self, record: logging.LogRecord) -> None:  # type: ignore[override]
            self.messages.append(self.format(record))

    return InspectingHandler()

    Fixture used to test the output of logger related output.
    
api/conftest.py