def project_path() -> Generator[Path, None, None]:
    """Return a temporary directory path that is used as the project directory for the entire test."""
    # Get the root directory of the project
    root_dir = Path(__file__).parent.parent

    # Create the temporary directory in the root directory of the project.
    # This is to access the test files in the project directory.
    tmp_dir = root_dir / "tmp"
    tmp_dir.mkdir(exist_ok=True)

    with TemporaryDirectory(dir=tmp_dir) as tmp_sub_dir:
        project_path = Path(tmp_sub_dir)
        # Restrict permissions (read and write for owner only)
        project_path.chmod(0o700)
        yield project_path

    # Clean up the temporary directory.
    shutil.rmtree(tmp_dir)
Return a temporary directory path that is used as the project directory for the entire test.
tests/conftest.py