Coverage for tests / unit / security / conftest.py: 78%

9 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2026-04-03 18:53 +0000

1"""Fixtures for security tests.""" 

2 

3from __future__ import annotations 

4 

5import tempfile 

6from pathlib import Path 

7from typing import TYPE_CHECKING 

8 

9import pytest 

10 

11if TYPE_CHECKING: 

12 from collections.abc import Generator 

13 

14 

15@pytest.fixture 

16def temp_project_dir() -> Generator[Path, None, None]: 

17 """Create a temporary directory to simulate a project root. 

18 

19 Yields: 

20 Path: Path to the temporary directory. 

21 """ 

22 with tempfile.TemporaryDirectory() as tmpdir: 

23 yield Path(tmpdir)