def test_remove_tasks_from_text(tmp_path: Path):
    """
    Test that when removal is enabled, task lines are removed from the document text.
    """
    content = "Intro text\n- [ ] Task 1\n- [x] Task 2\nConclusion text"
    create_markdown_file(tmp_path, "tasks_removed.md", content)

    reader = ObsidianReader(
        input_dir=str(tmp_path), extract_tasks=True, remove_tasks_from_text=True
    )
    docs = reader.load_data()
    assert len(docs) == 1
    doc = docs[0]
    tasks: List[str] = doc.metadata.get("tasks", [])
    assert "Task 1" in tasks
    assert "Task 2" in tasks
    # Ensure the task lines have been removed from the main text.
    assert "- [ ] Task 1" not in doc.text
    assert "- [x] Task 2" not in doc.text
    # Ensure that non-task text is still present.
    assert "Intro text" in doc.text
    assert "Conclusion text" in doc.text

    Test that when removal is enabled, task lines are removed from the document text.
    
llama-index-integrations/readers/llama-index-readers-obsidian/tests/test_readers_obsidian.py