Skip to content

Commit

Permalink
ci: disable ci ocr tests on windows because tesseract is hard to install
Browse files Browse the repository at this point in the history
  • Loading branch information
nmammeri committed Nov 17, 2024
1 parent 92300ba commit 17acfe5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/release_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,8 @@ jobs:
.venv\Scripts\activate.bat
pip install extractous --find-links bindings/extractous-python/dist --no-index --force-reinstall
pip install pytest scikit-learn
python --version
pip list
cd bindings\extractous-python
pytest -v -s .
pytest -s .
macos:
runs-on: ${{ matrix.platform.runner }}
Expand Down
8 changes: 7 additions & 1 deletion bindings/extractous-python/tests/test_ocr.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import sys

import pytest

from extractous import Extractor, PdfOcrStrategy, PdfParserConfig, TesseractOcrConfig
from utils import cosine_similarity


@pytest.mark.skipif(sys.platform.startswith("win"), reason="Test not supported on Windows")
def test_ara_ocr_png():
ocr_config = TesseractOcrConfig().set_language("ara")
extractor = Extractor().set_ocr_config(ocr_config)
Expand All @@ -13,6 +18,7 @@ def test_ara_ocr_png():
assert cosine_similarity(result, expected) > 0.9


@pytest.mark.skipif(sys.platform.startswith("win"), reason="Test not supported on Windows")
def test_extract_file_to_string_ocr_only_strategy_deu_ocr_pdf():
test_file = "../../test_files/documents/deu-ocr.pdf"
expected_result_file = "../../test_files/expected_result/deu-ocr.pdf.txt"
Expand All @@ -32,7 +38,7 @@ def test_extract_file_to_string_ocr_only_strategy_deu_ocr_pdf():

assert cosine_similarity(result, expected) > 0.9


@pytest.mark.skipif(sys.platform.startswith("win"), reason="Test not supported on Windows")
def test_test_extract_file_to_string_no_ocr_strategy_deu_ocr_pdf():
test_file = "../../test_files/documents/deu-ocr.pdf"

Expand Down

0 comments on commit 17acfe5

Please sign in to comment.