Skip to content

Commit 42169a6

Browse files
fix: Set PYTHONPATH in CI to resolve ModuleNotFoundError
Updates the backend testing workflow (`.github/workflows/backend-tests.yml`) to explicitly set `PYTHONPATH=.` for the pytest execution step. This ensures that modules within the `backend/app` directory are correctly discovered and imported by pytest during CI runs, addressing the `ModuleNotFoundError: No module named 'app.main'` error previously encountered.
1 parent 30e4db3 commit 42169a6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/backend-tests.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- 'backend/**'
88
- '.github/workflows/backend-tests.yml'
99
pull_request:
10-
branches: [ main , feature/auth-service-workflow]
10+
branches: [ main ]
1111
paths:
1212
- 'backend/**'
1313
- '.github/workflows/backend-tests.yml'
@@ -39,5 +39,7 @@ jobs:
3939
# pytest is already in requirements.txt
4040
4141
- name: Run tests with pytest
42+
env:
43+
PYTHONPATH: . # Add current directory (backend/) to PYTHONPATH
4244
run: |
4345
pytest # Pytest will discover tests in app/tests

0 commit comments

Comments
 (0)