chore: ruff lint 修复 + 第一优先级全部完成
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"""PDFSplitter 测试."""
|
||||
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
|
||||
pymupdf = pytest.importorskip("fitz", reason="pymupdf 未安装")
|
||||
|
||||
@@ -10,9 +10,10 @@ class TestPDFSplitter:
|
||||
|
||||
def test_split_simple_pdf(self, tmp_path):
|
||||
"""用 pymupdf 创建一个简单 PDF 并测试分块."""
|
||||
from src.core.splitters.pdf import PDFSplitter
|
||||
import fitz
|
||||
|
||||
from src.core.splitters.pdf import PDFSplitter
|
||||
|
||||
pdf_path = tmp_path / "test.pdf"
|
||||
doc = fitz.open()
|
||||
# 插入纯 ASCII 文本避免 CJK 字体编码问题
|
||||
@@ -29,9 +30,10 @@ class TestPDFSplitter:
|
||||
|
||||
def test_empty_pdf(self, tmp_path):
|
||||
"""空 PDF(有页但无文字)返回空列表."""
|
||||
from src.core.splitters.pdf import PDFSplitter
|
||||
import fitz
|
||||
|
||||
from src.core.splitters.pdf import PDFSplitter
|
||||
|
||||
pdf_path = tmp_path / "empty.pdf"
|
||||
doc = fitz.open()
|
||||
doc.new_page() # pymupdf 必须有至少一页才能保存
|
||||
|
||||
Reference in New Issue
Block a user