From 46a31fa0f725f7f5a8fe372e88f903ce8e8eca16 Mon Sep 17 00:00:00 2001 From: DARKZOUL5 Date: Wed, 18 Mar 2026 19:56:07 +0200 Subject: [PATCH] Refactor import handling in integration test to simplify sys.path management --- tests/integration_full_workflow_test.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/integration_full_workflow_test.py b/tests/integration_full_workflow_test.py index 7da9ed8..2561a89 100644 --- a/tests/integration_full_workflow_test.py +++ b/tests/integration_full_workflow_test.py @@ -12,18 +12,15 @@ import shutil import time from pathlib import Path -from src.downloader import PlaylistDownloader -from tests.dummy_config import DummyConfig - # Make imports robust when running the script directly from different working directories. -# Ensure the repository root and this tests folder are on sys.path so the script can import -# both the package (`src`) and local test helpers (`tests.temp_config`). +# Ensure the repository root is on sys.path so the script can import `src`. REPO_ROOT = Path(__file__).resolve().parents[1] -TESTS_DIR = Path(__file__).resolve().parent if str(REPO_ROOT) not in sys.path: sys.path.insert(0, str(REPO_ROOT)) -if str(TESTS_DIR) not in sys.path: - sys.path.insert(0, str(TESTS_DIR)) + +#import from src and tests +from src.downloader import PlaylistDownloader +from tests.dummy_config import DummyConfig if not os.getenv("INTEGRATION_TEST"): print("Skipping full integration test (set INTEGRATION_TEST=1 to enable)")