9797 - id : ruff-format
9898 files : ^apps/backend/
9999
100- # Python tests (apps/backend/) - skip slow/integration tests for pre-commit speed
100+ # Python tests (apps/backend/) - run full test suite from project root
101101 # Tests to skip: graphiti (external deps), merge_file_tracker/service_orchestrator/worktree/workspace (Windows path/git issues)
102- # NOTE: Skip this hook in worktrees (where .git is a file, not a directory)
103102 - repo : local
104103 hooks :
105104 - id : pytest
@@ -108,31 +107,24 @@ repos:
108107 args :
109108 - -c
110109 - |
111- # Skip in worktrees - .git is a file pointing to main repo, not a directory
112- # This prevents path resolution issues with ../../tests/ in worktree context
113- if [ -f ".git" ]; then
114- echo "Skipping pytest in worktree (path resolution would fail)"
115- exit 0
116- fi
117- cd apps/backend
118- if [ -f ".venv/bin/pytest" ]; then
119- PYTEST_CMD=".venv/bin/pytest"
120- elif [ -f ".venv/Scripts/pytest.exe" ]; then
121- PYTEST_CMD=".venv/Scripts/pytest.exe"
110+ # Run pytest directly from project root
111+ if [ -f "apps/backend/.venv/bin/pytest" ]; then
112+ PYTEST_CMD="apps/backend/.venv/bin/pytest"
113+ elif [ -f "apps/backend/.venv/Scripts/pytest.exe" ]; then
114+ PYTEST_CMD="apps/backend/.venv/Scripts/pytest.exe"
122115 else
123116 PYTEST_CMD="python -m pytest"
124117 fi
125- PYTHONPATH=. $PYTEST_CMD \
126- ../../tests/ \
118+ $PYTEST_CMD tests/ \
127119 -v \
128120 --tb=short \
129121 -x \
130122 -m "not slow and not integration" \
131- --ignore=../../ tests/test_graphiti.py \
132- --ignore=../../ tests/test_merge_file_tracker.py \
133- --ignore=../../ tests/test_service_orchestrator.py \
134- --ignore=../../ tests/test_worktree.py \
135- --ignore=../../ tests/test_workspace.py
123+ --ignore=tests/test_graphiti.py \
124+ --ignore=tests/test_merge_file_tracker.py \
125+ --ignore=tests/test_service_orchestrator.py \
126+ --ignore=tests/test_worktree.py \
127+ --ignore=tests/test_workspace.py
136128 language : system
137129 files : ^(apps/backend/.*\.py$|tests/.*\.py$)
138130 pass_filenames : false
0 commit comments