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:
https://github.com/Unstructured-IO/unstructured-api/issues/188 .

This failure was only showing up on the `main` branch, per the commented
out `pytest` skips.
This commit is contained in:
cragwolfe 2023-08-18 10:06:17 -07:00 committed by GitHub
parent 6001e2fa62
commit 1456f06b2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,17 +96,26 @@ def test_partition_via_api_raises_with_bad_response(monkeypatch):
partition_via_api(filename=filename) partition_via_api(filename=filename)
@pytest.mark.skipif(skip_outside_ci, reason="Skipping test run outside of CI") @pytest.mark.skip(
@pytest.mark.skipif(skip_not_on_main, reason="Skipping test run outside of main branch") reason="API is returning fast for auto, see "
"https://github.com/Unstructured-IO/unstructured-api/issues/188",
)
# @pytest.mark.skipif(skip_outside_ci, reason="Skipping test run outside of CI")
# @pytest.mark.skipif(skip_not_on_main, reason="Skipping test run outside of main branch")
def test_partition_via_api_with_no_strategy(): def test_partition_via_api_with_no_strategy():
filename = os.path.join(DIRECTORY, "..", "..", "example-docs", "layout-parser-paper-fast.jpg") filename = os.path.join(DIRECTORY, "..", "..", "example-docs", "layout-parser-paper-fast.jpg")
elements_no_strategy = partition_via_api(filename=filename, api_key=get_api_key()) elements_no_strategy = partition_via_api(
filename=filename,
strategy="auto",
api_key=get_api_key(),
)
elements_hi_res = partition_via_api(filename=filename, strategy="hi_res", api_key=get_api_key()) elements_hi_res = partition_via_api(filename=filename, strategy="hi_res", api_key=get_api_key())
# confirm that hi_res strategy was not passed as defaukt to partition by comparing outputs # confirm that hi_res strategy was not passed as default to partition by comparing outputs
assert elements_no_strategy[0].text.startswith("arXiv") # FIXME(crag): elements_hi_res[4].text is 'sacon oot barvard o', the fast output.
assert elements_hi_res[0].text.startswith("LayoutParser") # should be 'Harvard University {melissadell,jacob carlson}@fas.harvard.edu' (as of writing)
assert elements_no_strategy[4].text != elements_hi_res[4].text
@pytest.mark.skipif(skip_outside_ci, reason="Skipping test run outside of CI") @pytest.mark.skipif(skip_outside_ci, reason="Skipping test run outside of CI")