| """Fixtures compartidas para tests del proyecto.""" | |
| import os | |
| import sys | |
| from pathlib import Path | |
| import pytest | |
| PROJECT_ROOT = Path(__file__).resolve().parents[1] | |
| if str(PROJECT_ROOT) not in sys.path: | |
| sys.path.insert(0, str(PROJECT_ROOT)) | |
| def _project_cwd(): | |
| """Los módulos y configs usan rutas relativas al root del repo.""" | |
| prev = os.getcwd() | |
| os.chdir(PROJECT_ROOT) | |
| yield | |
| os.chdir(prev) | |
| def project_root() -> Path: | |
| return PROJECT_ROOT | |
| def features_config(project_root: Path) -> str: | |
| return str(project_root / "configs" / "features.yaml") | |
| def models_config(project_root: Path) -> str: | |
| return str(project_root / "configs" / "models.yaml") | |
| def best_params_config(project_root: Path) -> str: | |
| return str(project_root / "configs" / "best_params.yaml") | |