def test_successful_run_with_coverage(package_data, changed_packages):
    """Test a successful run with coverage checking."""
    with (
        mock.patch("llama_dev.test.load_pyproject", return_value=package_data),
        mock.patch("llama_dev.test.is_python_version_compatible", return_value=True),
        mock.patch(
            "llama_dev.test._uv_sync",
            return_value=mock.Mock(returncode=0),
        ),
        mock.patch("llama_dev.test.get_dep_names", return_value=[]),
        mock.patch(
            "llama_dev.test._pytest",
            return_value=mock.Mock(returncode=0, stdout="all tests passed", stderr=""),
        ),
        mock.patch(
            "llama_dev.test._diff_cover",
            return_value=mock.Mock(returncode=0, stdout="coverage ok", stderr=""),
        ),
    ):
        result = _run_tests(Path(), changed_packages, "main", True, 80)

        assert result["status"] == ResultStatus.TESTS_PASSED
        assert result["stdout"] == "coverage ok"
        assert "time" in result
Test a successful run with coverage checking.
llama-dev/tests/test/test_test.py