tests/conftest.py
def caplog(_caplog):  # noqa: F811
    """Override the caplog fixture to make pytest work with loguru.

    More info:
    https://loguru.readthedocs.io/en/stable/resources/migration.html#making-things-work-with-pytest-and-caplog
    """

    class PropogateHandler(logging.Handler):
        def emit(self, record):
            logging.getLogger(record.name).handle(record)

    handler_id = logger.add(PropogateHandler(), format="{message} {extra}")
    from nitpick import PROJECT_NAME

    logger.enable(PROJECT_NAME)
    yield _caplog
    logger.remove(handler_id)
    logger.disable(PROJECT_NAME)
Override the caplog fixture to make pytest work with loguru.

    More info:
    https://loguru.readthedocs.io/en/stable/resources/migration.html#making-things-work-with-pytest-and-caplog
    
Override the caplog fixture to make pytest work with loguru.
Override the caplog fixture to make pytest work with loguru .
def caplog(_caplog):  
    class PropogateHandler(logging.Handler):
        def emit(self, record):
            logging.getLogger(record.name).handle(record)
    handler_id = logger.add(PropogateHandler(), format="{message} {extra}")
    from nitpick import PROJECT_NAME
    logger.enable(PROJECT_NAME)
    yield _caplog
    logger.remove(handler_id)
    logger.disable(PROJECT_NAME)
def caplog ( _caplog ) : class PropogateHandler ( logging . Handler ) : def emit ( self , record ) : logging . getLogger ( record . name ) . handle ( record ) handler_id = logger . add ( PropogateHandler ( ) , format = "{message} {extra}" ) from nitpick import PROJECT_NAME logger . enable ( PROJECT_NAME ) yield _caplog logger . remove ( handler_id ) logger . disable ( PROJECT_NAME )
Override the caplog fixture to make pytest work with loguru.
Override the caplog fixture to make pytest work with loguru .
# noqa: F811 """Override the caplog fixture to make pytest work with loguru.

    More info:
    https://loguru.readthedocs.io/en/stable/resources/migration.html#making-things-work-with-pytest-and-caplog
    """
_caplog