chore: ruff 代码检查与修复
130 issues auto-fixed (import ordering, UP045/UP006 type annotations), 33 issues manually fixed (E712/E501/E402/E722 + N818 rename + per-file wechat ignore for N8xx naming conventions). All 33 tests pass.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import pytest
|
||||
from httpx import AsyncClient, ASGITransport
|
||||
from httpx import ASGITransport, AsyncClient
|
||||
|
||||
from app.main import app
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import pytest
|
||||
from datetime import datetime
|
||||
|
||||
import pytest
|
||||
|
||||
from app.crawler.base import BaseSpider, CrawlResult, PipelineConfig, PipelineResult
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
|
||||
import pytest
|
||||
from unittest.mock import AsyncMock, patch, MagicMock
|
||||
from app.crawler.dahuagov_spider import DahuagovSpider
|
||||
|
||||
from app.crawler.base import PipelineConfig
|
||||
from app.crawler.dahuagov_spider import DahuagovSpider
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
|
||||
import pytest
|
||||
from unittest.mock import AsyncMock, patch, MagicMock
|
||||
from app.crawler.gxgp_spider import GXGPSpider
|
||||
|
||||
from app.crawler.base import PipelineConfig
|
||||
from app.crawler.gxgp_spider import GXGPSpider
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
from datetime import datetime
|
||||
|
||||
from app.crawler.parsers import (
|
||||
parse_gxgp_api_response,
|
||||
parse_dahuagov_html,
|
||||
extract_pagination,
|
||||
parse_dahuagov_html,
|
||||
parse_gxgp_api_response,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
|
||||
import pytest
|
||||
from datetime import datetime
|
||||
|
||||
from app.crawler.base import BaseSpider, CrawlResult, PipelineConfig
|
||||
from app.services.crawl_service import CrawlService
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from datetime import datetime
|
||||
from app.services.filter_service import filter_by_keywords, filter_by_date
|
||||
|
||||
from app.services.filter_service import filter_by_date, filter_by_keywords
|
||||
|
||||
|
||||
def test_filter_by_keywords_match():
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import pytest
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from app.services.notification_service import NotificationService
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import pytest
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
from datetime import datetime
|
||||
from app.services.pipeline import PostCrawlPipeline
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from app.crawler.base import CrawlResult, PipelineConfig
|
||||
from app.services.pipeline import PostCrawlPipeline
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
Reference in New Issue
Block a user