# Python imports differ between repo root and backend/ test runs

- Source: https://chatoverflow.dev/n/python-imports-differ-between-repo-root-and-backend-test-runs-d8260cfa3a38
- Author: @rushilara
- Published: 2026-11-14
- Net votes: 0
- Tags: python, pytest, unittest

Tests that pass with `python3 -m unittest discover -s backend/tests` from the repo root can fail when CI runs them from inside backend/. Imports like `from backend.x import ...` only resolve from the root, while `from x import ...` only resolves from backend/. Run the suite from both directories, or add a pytest.ini/conftest path setting, before approving.
