Loading src/pool_executors/pool_executors/runner.py +1 −2 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ from __future__ import annotations import asyncio import functools from collections.abc import Callable from concurrent.futures import Executor from typing import Any, TypeVar Loading Loading @@ -85,8 +86,6 @@ class Runner: # Run function in executor if kwargs: import functools return await self._loop.run_in_executor(self._executor, functools.partial(func, *args, **kwargs)) return await self._loop.run_in_executor(self._executor, func, *args) Loading src/tdoc_crawler/checkout.py +2 −2 Original line number Diff line number Diff line Loading @@ -168,9 +168,9 @@ def checkout_tdoc( with suppress(FileNotFoundError): (downloads_dir / filename).unlink() import importlib import importlib # noqa: PLC0415 from tdoc_crawler.cli.helpers import prepare_tdoc_file from tdoc_crawler.cli.helpers import prepare_tdoc_file # noqa: PLC0415 cli_helpers = importlib.import_module("tdoc_crawler.cli.helpers") original_download = cli_helpers.download_to_path Loading tests/test_cli.py +1 −12 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ from __future__ import annotations from decimal import Decimal from pathlib import Path from unittest.mock import MagicMock, patch Loading Loading @@ -453,10 +454,6 @@ class TestOpenCommand: 5. whatthespec returns valid metadata 6. TDoc is inserted and file is opened """ from decimal import Decimal from tdoc_crawler.models import TDocMetadata mock_db = MagicMock(spec=TDocDatabase) mock_db_class.return_value.__enter__.return_value = mock_db # Database returns no results initially Loading Loading @@ -536,10 +533,6 @@ class TestOpenCommand: 3. whatthespec resolver provides metadata 4. TDoc is opened without requiring portal credentials """ from decimal import Decimal from tdoc_crawler.models import TDocMetadata mock_db = MagicMock(spec=TDocDatabase) mock_db_class.return_value.__enter__.return_value = mock_db mock_db.query_tdocs.return_value = [] Loading Loading @@ -620,10 +613,6 @@ class TestCheckoutCommand: 4. whatthespec fallback resolves TDocs 5. checkout_tdoc called for resolved TDocs """ from decimal import Decimal from tdoc_crawler.models import TDocMetadata mock_db = MagicMock(spec=TDocDatabase) mock_db_class.return_value.__enter__.return_value = mock_db mock_db.query_tdocs.return_value = [] Loading tests/test_meeting_document_list.py +2 −2 Original line number Diff line number Diff line Loading @@ -107,7 +107,7 @@ class TestMeetingDocumentList: with pytest.raises(Exception): # DocumentListError or pandas error parse_excel_document_list(excel_content, meeting_id=12345) def test_fetch_meeting_document_list_network_error(self) -> None: def test_fetch_meeting_document_list_network_error(self, tmp_path: Path) -> None: """Test handling of network errors.""" with patch("tdoc_crawler.crawlers.meeting_doclist.create_cached_session") as mock_session: mock_response = MagicMock() Loading @@ -117,7 +117,7 @@ class TestMeetingDocumentList: with pytest.raises(DocumentListError): fetch_meeting_document_list( meeting_id=12345, cache_dir=Path("/tmp"), cache_dir=tmp_path, ) def test_hybrid_crawler_document_list_only(self) -> None: Loading Loading
src/pool_executors/pool_executors/runner.py +1 −2 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ from __future__ import annotations import asyncio import functools from collections.abc import Callable from concurrent.futures import Executor from typing import Any, TypeVar Loading Loading @@ -85,8 +86,6 @@ class Runner: # Run function in executor if kwargs: import functools return await self._loop.run_in_executor(self._executor, functools.partial(func, *args, **kwargs)) return await self._loop.run_in_executor(self._executor, func, *args) Loading
src/tdoc_crawler/checkout.py +2 −2 Original line number Diff line number Diff line Loading @@ -168,9 +168,9 @@ def checkout_tdoc( with suppress(FileNotFoundError): (downloads_dir / filename).unlink() import importlib import importlib # noqa: PLC0415 from tdoc_crawler.cli.helpers import prepare_tdoc_file from tdoc_crawler.cli.helpers import prepare_tdoc_file # noqa: PLC0415 cli_helpers = importlib.import_module("tdoc_crawler.cli.helpers") original_download = cli_helpers.download_to_path Loading
tests/test_cli.py +1 −12 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ from __future__ import annotations from decimal import Decimal from pathlib import Path from unittest.mock import MagicMock, patch Loading Loading @@ -453,10 +454,6 @@ class TestOpenCommand: 5. whatthespec returns valid metadata 6. TDoc is inserted and file is opened """ from decimal import Decimal from tdoc_crawler.models import TDocMetadata mock_db = MagicMock(spec=TDocDatabase) mock_db_class.return_value.__enter__.return_value = mock_db # Database returns no results initially Loading Loading @@ -536,10 +533,6 @@ class TestOpenCommand: 3. whatthespec resolver provides metadata 4. TDoc is opened without requiring portal credentials """ from decimal import Decimal from tdoc_crawler.models import TDocMetadata mock_db = MagicMock(spec=TDocDatabase) mock_db_class.return_value.__enter__.return_value = mock_db mock_db.query_tdocs.return_value = [] Loading Loading @@ -620,10 +613,6 @@ class TestCheckoutCommand: 4. whatthespec fallback resolves TDocs 5. checkout_tdoc called for resolved TDocs """ from decimal import Decimal from tdoc_crawler.models import TDocMetadata mock_db = MagicMock(spec=TDocDatabase) mock_db_class.return_value.__enter__.return_value = mock_db mock_db.query_tdocs.return_value = [] Loading
tests/test_meeting_document_list.py +2 −2 Original line number Diff line number Diff line Loading @@ -107,7 +107,7 @@ class TestMeetingDocumentList: with pytest.raises(Exception): # DocumentListError or pandas error parse_excel_document_list(excel_content, meeting_id=12345) def test_fetch_meeting_document_list_network_error(self) -> None: def test_fetch_meeting_document_list_network_error(self, tmp_path: Path) -> None: """Test handling of network errors.""" with patch("tdoc_crawler.crawlers.meeting_doclist.create_cached_session") as mock_session: mock_response = MagicMock() Loading @@ -117,7 +117,7 @@ class TestMeetingDocumentList: with pytest.raises(DocumentListError): fetch_meeting_document_list( meeting_id=12345, cache_dir=Path("/tmp"), cache_dir=tmp_path, ) def test_hybrid_crawler_document_list_only(self) -> None: Loading