diff --git a/project/swelancer/swelancer/utils/custom_logging.py b/project/swelancer/swelancer/utils/custom_logging.py index 48db230a..1f47f145 100644 --- a/project/swelancer/swelancer/utils/custom_logging.py +++ b/project/swelancer/swelancer/utils/custom_logging.py @@ -1,5 +1,4 @@ import time -from pathlib import Path import blobfile as bf import structlog @@ -8,6 +7,7 @@ from nanoeval.library_config import LibraryConfig, set_library_config from nanoeval.setup import nanoeval_logging +from swelancer.utils.general import get_runs_dir def get_timestamp() -> str: @@ -17,7 +17,7 @@ def get_timestamp() -> str: def get_default_runs_dir() -> str: - return str(Path(__name__).parent / "runs") + return str(get_runs_dir()) def setup_logging(library_config: LibraryConfig) -> None: diff --git a/project/swelancer/tests/test_custom_logging.py b/project/swelancer/tests/test_custom_logging.py new file mode 100644 index 00000000..5c384d7a --- /dev/null +++ b/project/swelancer/tests/test_custom_logging.py @@ -0,0 +1,11 @@ +from pathlib import Path + +from swelancer.utils.custom_logging import get_default_runs_dir +from swelancer.utils.general import get_runs_dir + + +def test_default_runs_dir_uses_project_runs_directory() -> None: + default_runs_dir = Path(get_default_runs_dir()) + + assert default_runs_dir == get_runs_dir() + assert default_runs_dir.is_absolute()