From 35dfde74e2158dc3495b4b98172821cec9a28e1f Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Fri, 23 Aug 2024 13:39:22 +0200 Subject: [PATCH] fix log test --- tests/unit/basic_crawler/test_basic_crawler.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/unit/basic_crawler/test_basic_crawler.py b/tests/unit/basic_crawler/test_basic_crawler.py index 517d455b3..ecbdfa313 100644 --- a/tests/unit/basic_crawler/test_basic_crawler.py +++ b/tests/unit/basic_crawler/test_basic_crawler.py @@ -10,6 +10,7 @@ from pathlib import Path from typing import TYPE_CHECKING, Any from unittest.mock import Mock +from weakref import CallableProxyType import httpx import pytest @@ -641,6 +642,9 @@ async def handler(context: BasicCrawlingContext) -> None: async def test_logs_final_statistics(monkeypatch: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture) -> None: + # Set the log level to INFO to capture the final statistics log. + caplog.set_level(logging.INFO) + crawler = BasicCrawler(configure_logging=False) @crawler.router.default_handler