Skip to content

Commit d48fa3b

Browse files
authored
rfctr(auto): improve typing and organize auto tests (#3355)
**Summary** In preparation for further work on auto-partitioning (`partition()`), improve typing and organize `test_auto.py` by introducing categories.
1 parent 609a08a commit d48fa3b

File tree

4 files changed

+817
-637
lines changed

4 files changed

+817
-637
lines changed

Diff for: CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 0.14.10-dev12
1+
## 0.14.10-dev13
22

33
### Enhancements
44

Diff for: test_unstructured/partition/pdf_image/test_pdf.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import base64
24
import logging
35
import math
@@ -17,6 +19,7 @@
1719
from unstructured.documents.coordinates import PixelSpace
1820
from unstructured.documents.elements import (
1921
CoordinatesMetadata,
22+
Element,
2023
ElementMetadata,
2124
ElementType,
2225
Footer,
@@ -1182,11 +1185,14 @@ def test_extractable_elements_repair_invalid_pdf_structure(filename, expected_lo
11821185

11831186

11841187
def assert_element_extraction(
1185-
elements, extract_image_block_types, extract_image_block_to_payload, tmpdir
1188+
elements: list[Element],
1189+
extract_image_block_types: list[str],
1190+
extract_image_block_to_payload: bool,
1191+
tmpdir: str,
11861192
):
1187-
extracted_elements = []
1193+
extracted_elements: list[list[Element]] = []
11881194
for el_type in extract_image_block_types:
1189-
extracted_elements_by_type = []
1195+
extracted_elements_by_type: list[Element] = []
11901196
for el in elements:
11911197
if el.category == el_type:
11921198
extracted_elements_by_type.append(el)

0 commit comments

Comments
 (0)