25 lines
505 B
Python
25 lines
505 B
Python
import pytest
|
|
import tempfile
|
|
import os
|
|
|
|
@pytest.fixture
|
|
def temp_git_repo():
|
|
"""Create a temporary git repository."""
|
|
with tempfile.TemporaryDirectory() as tmpdir:
|
|
os.chdir(tmpdir)
|
|
os.system('git init')
|
|
yield tmpdir
|
|
|
|
@pytest.fixture
|
|
def sample_diff():
|
|
"""Sample diff for testing."""
|
|
return """diff --git a/main.py b/main.py
|
|
index 1234567..abcdefg 100644
|
|
--- a/main.py
|
|
+++ b/main.py
|
|
@@ -1,3 +1,4 @@
|
|
def hello():
|
|
+ print("Hello, World!")
|
|
return "Hello"
|
|
"""
|