Python tool for converting files and office documents to Markdown.
Expand test matrix to include windows-latest (#2453)
afourney73a26dac0934
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.ymlindex 7e6b6ba5..6c6f1942 100644--- a/.github/workflows/tests.yml+++ b/.github/workflows/tests.yml@@ -3,12 +3,17 @@ on: [pull_request]permissions:contents: read+env:+ # Preserve Unicode in captured CLI output on Windows.+ PYTHONUTF8: "1"+jobs:tests:- runs-on: ubuntu-latest+ runs-on: ${{ matrix.os }}strategy:fail-fast: falsematrix:+ os: [ubuntu-latest, windows-latest]python-version: ["3.10", "3.11", "3.12", "3.13"]steps:@@ -20,14 +25,16 @@ jobs:- name: Install Hatchrun: pipx install hatch- name: Run tests- run: cd packages/markitdown; hatch test -py=${{ matrix.python-version }}+ working-directory: packages/markitdown+ run: hatch test -py=${{ matrix.python-version }}ocr-tests:- runs-on: ubuntu-latest+ runs-on: ${{ matrix.os }}strategy:fail-fast: falsematrix:+ os: [ubuntu-latest, windows-latest]python-version: ["3.10", "3.11", "3.12", "3.13"]steps:@@ -47,10 +54,11 @@ jobs:mcp-tests:- runs-on: ubuntu-latest+ runs-on: ${{ matrix.os }}strategy:fail-fast: falsematrix:+ os: [ubuntu-latest, windows-latest]python-version: ["3.10", "3.11", "3.12", "3.13"]steps:diff --git a/packages/markitdown/tests/test_module_misc.py b/packages/markitdown/tests/test_module_misc.pyindex 160de20a..84035c4b 100644--- a/packages/markitdown/tests/test_module_misc.py+++ b/packages/markitdown/tests/test_module_misc.py@@ -311,33 +311,36 @@ def test_uppercase_data_image_uri_is_truncated_by_default() -> None:def test_file_uris() -> None:+ expected_path = os.path.abspath("/path/to/file.txt")+# Test file URI with an empty hostfile_uri = "file:///path/to/file.txt"netloc, path = file_uri_to_path(file_uri)assert netloc is None- assert path == "/path/to/file.txt"+ assert path == expected_path# Test file URI with no hostfile_uri = "file:/path/to/file.txt"netloc, path = file_uri_to_path(file_uri)assert netloc is None- assert path == "/path/to/file.txt"+ assert path == expected_path# Test file URI with localhostfile_uri = "file://localhost/path/to/file.txt"netloc, path = file_uri_to_path(file_uri)assert netloc == "localhost"- assert path == "/path/to/file.txt"+ assert path == expected_path# URI schemes are case-insensitivefile_uri = "FILE:///path/to/file.txt"netloc, path = file_uri_to_path(file_uri)assert netloc is None- assert path == "/path/to/file.txt"+ assert path == expected_pathdef test_convert_case_insensitive_uri_schemes(tmp_path) -> None:markitdown = MarkItDown()+ expected_path = os.path.abspath("/path/to/file.txt")data_result = markitdown.convert("DATA:text/plain;base64,SGVsbG8sIFdvcmxkIQ==")assert data_result.markdown == "Hello, World!"@@ -352,13 +355,13 @@ def test_convert_case_insensitive_uri_schemes(tmp_path) -> None:file_uri = "file:///path/to/file.txt?param=value"netloc, path = file_uri_to_path(file_uri)assert netloc is None- assert path == "/path/to/file.txt"+ assert path == expected_path# Test file URI with fragmentfile_uri = "file:///path/to/file.txt#fragment"netloc, path = file_uri_to_path(file_uri)assert netloc is None- assert path == "/path/to/file.txt"+ assert path == expected_pathdef test_file_uri_with_percent_encoded_windows_drive(@@ -1059,6 +1062,10 @@ def test_deeply_nested_rss_item_fallback() -> None:assert "<p>" not in result.markdown+ os.name == "nt",+ reason="The DOCX fixture embeds a POSIX file:///tmp/test_rlink.txt target.",+)def test_doc_rlink() -> None:# Test for: CVE-2025-11849markitdown = MarkItDown()