def test_tasks_extraction(tmp_path: Path):
    """
    Test that markdown tasks are correctly extracted into metadata when removal is disabled.
    """
    content = (
        "Task list:\n"
        "- [ ] Task A\n"
        "Some intervening text\n"
        "- [x] Task B\n"
        "More text follows."
    )
    create_markdown_file(tmp_path, "tasks.md", content)

    reader = ObsidianReader(
        input_dir=str(tmp_path), extract_tasks=True, remove_tasks_from_text=False
    )
    docs = reader.load_data()
    assert len(docs) == 1
    doc = docs[0]
    tasks: List[str] = doc.metadata.get("tasks", [])
    # Check that tasks are extracted.
    assert "Task A" in tasks
    assert "Task B" in tasks
    # Since removal is disabled, the original text should still contain the task lines.
    assert "- [ ] Task A" in doc.text
    assert "- [x] Task B" in doc.text

    Test that markdown tasks are correctly extracted into metadata when removal is disabled.
    
llama-index-integrations/readers/llama-index-readers-obsidian/tests/test_readers_obsidian.py