MCPcopy Create free account
hub / github.com/bhowiebkr/PyFlowGraph / get_changed_files

Method get_changed_files

testing/test_runner.py:75–86  ·  view source on GitHub ↗

Get list of changed files using git (if available).

(self)

Source from the content-addressed store, hash-verified

73 return "pytest"
74
75 def get_changed_files(self) -> List[str]:
76 """Get list of changed files using git (if available)."""
77 try:
78 result = subprocess.run(
79 ["git", "diff", "--name-only", "HEAD~1"],
80 capture_output=True, text=True, timeout=5
81 )
82 if result.returncode == 0:
83 return [f for f in result.stdout.strip().split('\n') if f.endswith('.py')]
84 except (subprocess.TimeoutExpired, FileNotFoundError):
85 pass
86 return []
87
88 def map_files_to_tests(self, changed_files: List[str]) -> List[str]:
89 """Map changed source files to their corresponding test files."""

Callers 1

build_pytest_commandMethod · 0.95

Calls 1

runMethod · 0.45

Tested by

no test coverage detected