← ClaudeAtlas

markitdown-testinglisted

Write and run tests for MarkItDown converters. Use when: adding tests for a new converter, writing parametrized test vectors, running pytest with hatch, understanding FileTestVector pattern, or debugging test failures. Covers test file layout, FileTestVector dataclass, parametrized test patterns, remote test skipping, and coverage.
JZKK720/cubecloud-skills-bundle-kit · ★ 3 · AI & Automation · score 66
Install: claude install-skill JZKK720/cubecloud-skills-bundle-kit
# MarkItDown Testing ## Quick Reference ### Test File Layout ``` packages/<pkg>/tests/ ├── __init__.py ├── _test_vectors.py # FileTestVector dataclass + test vector lists ├── test_module_vectors.py # Parametrized tests for convert_local/stream/uri ├── test_module_misc.py # Non-vector tests (LLM, exiftool, specific formats) ├── test_cli_vectors.py # CLI tests (stdout, file output, stdin) ├── test_cli_misc.py # CLI version flag, error handling └── test_files/ # Test input files ├── test.docx ├── test.pdf └── expected_outputs/ # Expected conversion outputs ``` ### FileTestVector ```python @dataclasses.dataclass(frozen=True, kw_only=True) class FileTestVector: filename: str # Relative to test_files/ mimetype: str | None # Expected MIME type charset: str | None # Expected charset url: str | None # Optional URL for remote tests must_include: List[str] # Strings that MUST appear in output must_not_include: List[str] # Strings that MUST NOT appear ``` ### Parametrized Test Pattern ```python import pytest from ._test_vectors import MY_TEST_VECTORS @pytest.mark.parametrize("test_vector", MY_TEST_VECTORS) def test_convert_local(test_vector): markitdown = MarkItDown() result = markitdown.convert( os.path.join(TEST_FILES_DIR, test_vector.filename) ) for s in test_vector.must_include: assert s in result.markdown for s in