Create a temporary git repository for testing.
()
| 22 | |
| 23 | @pytest.fixture |
| 24 | def temp_repo(): |
| 25 | """Create a temporary git repository for testing.""" |
| 26 | with tempfile.TemporaryDirectory() as temp_dir: |
| 27 | init_git_repo(temp_dir) |
| 28 | |
| 29 | # Create and commit initial file |
| 30 | file_path = Path(temp_dir) / "test.txt" |
| 31 | file_path.write_text("initial content\nline2\nline3\n") |
| 32 | |
| 33 | repo = Repo(temp_dir) |
| 34 | repo.index.add(["test.txt"]) |
| 35 | add_all_files_and_commit(temp_dir, FUNCTIONAL_REQUIREMENT_FINISHED_COMMIT_MESSAGE.format("1.1")) |
| 36 | |
| 37 | yield temp_dir |
| 38 | |
| 39 | |
| 40 | @pytest.fixture |
nothing calls this directly
no test coverage detected