Skip to content

Commit 1456f06

Browse files
authored
chore: skip consistently failing test in main (#1150)
The reason this test is failing is the API is returning "fast" results when "hi_res" is requested, which is being tracked in this ticket: Unstructured-IO/unstructured-api#188 . This failure was only showing up on the `main` branch, per the commented out `pytest` skips.
1 parent 6001e2f commit 1456f06

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

Diff for: test_unstructured/partition/test_api.py

+15-6
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,26 @@ def test_partition_via_api_raises_with_bad_response(monkeypatch):
9696
partition_via_api(filename=filename)
9797

9898

99-
@pytest.mark.skipif(skip_outside_ci, reason="Skipping test run outside of CI")
100-
@pytest.mark.skipif(skip_not_on_main, reason="Skipping test run outside of main branch")
99+
@pytest.mark.skip(
100+
reason="API is returning fast for auto, see "
101+
"https://github.com/Unstructured-IO/unstructured-api/issues/188",
102+
)
103+
# @pytest.mark.skipif(skip_outside_ci, reason="Skipping test run outside of CI")
104+
# @pytest.mark.skipif(skip_not_on_main, reason="Skipping test run outside of main branch")
101105
def test_partition_via_api_with_no_strategy():
102106
filename = os.path.join(DIRECTORY, "..", "..", "example-docs", "layout-parser-paper-fast.jpg")
103107

104-
elements_no_strategy = partition_via_api(filename=filename, api_key=get_api_key())
108+
elements_no_strategy = partition_via_api(
109+
filename=filename,
110+
strategy="auto",
111+
api_key=get_api_key(),
112+
)
105113
elements_hi_res = partition_via_api(filename=filename, strategy="hi_res", api_key=get_api_key())
106114

107-
# confirm that hi_res strategy was not passed as defaukt to partition by comparing outputs
108-
assert elements_no_strategy[0].text.startswith("arXiv")
109-
assert elements_hi_res[0].text.startswith("LayoutParser")
115+
# confirm that hi_res strategy was not passed as default to partition by comparing outputs
116+
# FIXME(crag): elements_hi_res[4].text is 'sacon oot barvard o', the fast output.
117+
# should be 'Harvard University {melissadell,jacob carlson}@fas.harvard.edu' (as of writing)
118+
assert elements_no_strategy[4].text != elements_hi_res[4].text
110119

111120

112121
@pytest.mark.skipif(skip_outside_ci, reason="Skipping test run outside of CI")

0 commit comments

Comments
 (0)