Chore(mypy): Annotate None returns for typing improvements (#11213)

This commit is contained in:
Sebastian Steinbeißer
2026-02-02 17:44:12 +01:00
committed by GitHub
parent a9c0b06e28
commit 3b5ffbf9fa
113 changed files with 1598 additions and 1510 deletions

View File

@@ -5,13 +5,21 @@ from paperless_text.parsers import TextDocumentParser
class TestTextParser:
def test_thumbnail(self, text_parser: TextDocumentParser, sample_txt_file: Path):
def test_thumbnail(
self,
text_parser: TextDocumentParser,
sample_txt_file: Path,
) -> None:
# just make sure that it does not crash
f = text_parser.get_thumbnail(sample_txt_file, "text/plain")
assert f.exists()
assert f.is_file()
def test_parse(self, text_parser: TextDocumentParser, sample_txt_file: Path):
def test_parse(
self,
text_parser: TextDocumentParser,
sample_txt_file: Path,
) -> None:
text_parser.parse(sample_txt_file, "text/plain")
assert text_parser.get_text() == "This is a test file.\n"
@@ -21,7 +29,7 @@ class TestTextParser:
self,
text_parser: TextDocumentParser,
malformed_txt_file: Path,
):
) -> None:
"""
GIVEN:
- Text file which contains invalid UTF bytes
@@ -37,7 +45,7 @@ class TestTextParser:
assert text_parser.get_text() == "Pantothens<EFBFBD>ure\n"
assert text_parser.get_archive_path() is None
def test_thumbnail_large_file(self, text_parser: TextDocumentParser):
def test_thumbnail_large_file(self, text_parser: TextDocumentParser) -> None:
"""
GIVEN:
- A very large text file (>50MB)