diff --git a/tests/logger_loguru/test_attributes.py b/tests/logger_loguru/test_attributes.py index 114b15ac53..e15cc9aec3 100644 --- a/tests/logger_loguru/test_attributes.py +++ b/tests/logger_loguru/test_attributes.py @@ -53,14 +53,14 @@ def _patcher(d): bound_logger.error("context_attrs: {}", "arg1", kwarg_attr=4) -@validate_log_events([{"message": "exc_info"}], required_attrs=["context.file"]) +@validate_log_events([{"message": "exc_info"}], required_attrs=["context.exception"]) @validate_log_event_count(1) @background_task() def test_loguru_exception_context_attributes(logger): try: raise RuntimeError("Oops") except Exception: - logger.error("exc_info") + logger.opt(exception=True).error("exc_info") @validate_log_events([{"context.extra.attr": 1}])