From b95bf287bfb1f201d7c7f7f0fad93df073a0f889 Mon Sep 17 00:00:00 2001 From: Oliver Falk Date: Thu, 16 Oct 2025 19:59:25 +0200 Subject: [PATCH] Fix Python path issue in coverage script - Add current directory to Python path before calling django.setup() - This fixes ModuleNotFoundError: No module named 'ivatar' - The script now properly finds the ivatar module when running tests - Coverage should now work correctly with Django test runner --- scripts/run_tests_with_coverage.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/run_tests_with_coverage.py b/scripts/run_tests_with_coverage.py index d1e9699..aadd2ca 100755 --- a/scripts/run_tests_with_coverage.py +++ b/scripts/run_tests_with_coverage.py @@ -22,6 +22,9 @@ def main(): print("Running tests with OpenTelemetry enabled...") print("==========================================") + # Add current directory to Python path + sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + # Setup Django os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ivatar.settings") django.setup()