Skip to content

Commit c3ca1dd

Browse files
committed
Fix make check
1 parent 458f05b commit c3ca1dd

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

test_unstructured_inference/inference/test_layout.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -305,22 +305,18 @@ def mock_get_elements(self, *args, **kwargs):
305305
@pytest.mark.slow()
306306
def test_from_file_with_password(monkeypatch, mock_final_layout):
307307

308-
doc = layout.DocumentLayout.from_file(
309-
"sample-docs/password.pdf",
310-
password="password")
308+
doc = layout.DocumentLayout.from_file("sample-docs/password.pdf", password="password")
311309
assert doc
312310

313-
monkeypatch.setattr(layout, "get_model",
314-
lambda x: MockLayoutModel(mock_final_layout))
311+
monkeypatch.setattr(layout, "get_model", lambda x: MockLayoutModel(mock_final_layout))
315312
with patch(
316313
"unstructured_inference.inference.layout.UnstructuredObjectDetectionModel",
317314
MockLayoutModel,
318-
), open("sample-docs/password.pdf",mode="rb") as fp:
315+
), open("sample-docs/password.pdf", mode="rb") as fp:
319316
doc = layout.process_data_with_model(fp, model_name="fake", password="password")
320317
assert doc
321318

322319

323-
324320
def test_from_image_file_raises_with_empty_fn():
325321
with pytest.raises(FileNotFoundError):
326322
layout.DocumentLayout.from_image_file("")

test_unstructured_inference/models/test_tables.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
from copy import deepcopy
23

34
import numpy as np
45
import pytest
@@ -7,11 +8,13 @@
78
from transformers.models.table_transformer.modeling_table_transformer import (
89
TableTransformerDecoder,
910
)
10-
from copy import deepcopy
1111

1212
import unstructured_inference.models.table_postprocess as postprocess
1313
from unstructured_inference.models import tables
14-
from unstructured_inference.models.tables import apply_thresholds_on_objects, structure_to_cells
14+
from unstructured_inference.models.tables import (
15+
apply_thresholds_on_objects,
16+
structure_to_cells,
17+
)
1518

1619
skip_outside_ci = os.getenv("CI", "").lower() in {"", "false", "f", "0"}
1720

unstructured_inference/inference/layout.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def from_file(
5151
filename: str,
5252
fixed_layouts: Optional[List[Optional[List[TextRegion]]]] = None,
5353
pdf_image_dpi: int = 200,
54-
password:Optional[str] = None,
54+
password: Optional[str] = None,
5555
**kwargs,
5656
) -> DocumentLayout:
5757
"""Creates a DocumentLayout from a pdf file."""
@@ -135,7 +135,7 @@ def __init__(
135135
document_filename: Optional[Union[str, PurePath]] = None,
136136
detection_model: Optional[UnstructuredObjectDetectionModel] = None,
137137
element_extraction_model: Optional[UnstructuredElementExtractionModel] = None,
138-
password:Optional[str] = None,
138+
password: Optional[str] = None,
139139
):
140140
if detection_model is not None and element_extraction_model is not None:
141141
raise ValueError("Only one of detection_model and extraction_model should be passed.")

0 commit comments

Comments
 (0)