|
2 | 2 |
|
3 | 3 | from __future__ import annotations |
4 | 4 |
|
5 | | -import io |
6 | 5 | import json |
7 | 6 | import os |
8 | 7 | import pathlib |
@@ -561,7 +560,6 @@ def test_auto_partition_pdf_with_fast_strategy(request: FixtureRequest): |
561 | 560 | strategy=PartitionStrategy.FAST, |
562 | 561 | languages=None, |
563 | 562 | metadata_filename=None, |
564 | | - include_page_breaks=False, |
565 | 563 | infer_table_structure=False, |
566 | 564 | extract_images_in_pdf=False, |
567 | 565 | extract_image_block_types=None, |
@@ -897,7 +895,7 @@ def test_auto_partition_raises_with_bad_type(request: FixtureRequest): |
897 | 895 |
|
898 | 896 | with pytest.raises( |
899 | 897 | UnsupportedFileFormatError, |
900 | | - match="Invalid file made-up.fake. The FileType.UNK file type is not supported in partiti", |
| 898 | + match="Partitioning is not supported for the FileType.UNK file type.", |
901 | 899 | ): |
902 | 900 | partition(filename="made-up.fake", strategy=PartitionStrategy.HI_RES) |
903 | 901 |
|
@@ -1037,26 +1035,6 @@ def test_auto_partition_forwards_metadata_filename_via_kwargs(): |
1037 | 1035 | assert all(e.metadata.filename == "much-more-interesting-name.txt" for e in elements) |
1038 | 1036 |
|
1039 | 1037 |
|
1040 | | -def test_auto_partition_warns_about_file_filename_deprecation(caplog: LogCaptureFixture): |
1041 | | - file_path = example_doc_path("fake-text.txt") |
1042 | | - |
1043 | | - with open(file_path, "rb") as f: |
1044 | | - elements = partition(file=f, file_filename=file_path) |
1045 | | - |
1046 | | - assert all(e.metadata.filename == "fake-text.txt" for e in elements) |
1047 | | - assert caplog.records[0].levelname == "WARNING" |
1048 | | - assert "The file_filename kwarg will be deprecated" in caplog.text |
1049 | | - |
1050 | | - |
1051 | | -def test_auto_partition_raises_when_both_file_filename_and_metadata_filename_args_are_used(): |
1052 | | - file_path = example_doc_path("fake-text.txt") |
1053 | | - with open(file_path, "rb") as f: |
1054 | | - file = io.BytesIO(f.read()) |
1055 | | - |
1056 | | - with pytest.raises(ValueError, match="Only one of metadata_filename and file_filename is spe"): |
1057 | | - partition(file=file, file_filename=file_path, metadata_filename=file_path) |
1058 | | - |
1059 | | - |
1060 | 1038 | # -- ocr_languages -------------------------------------------------------- |
1061 | 1039 |
|
1062 | 1040 |
|
|
0 commit comments