diff --git a/tests/conftest.py b/tests/conftest.py index 0d3de2a287..4ae45fd9e3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -152,6 +152,9 @@ def pytest_sessionfinish(session: pytest.Session, exitstatus: int): @pytest.fixture(autouse=True) -def setup_mlflow_tracking(monkeypatch): +def setup_mlflow_tracking(monkeypatch, tmp_path): mlflow = pytest.importorskip('mlflow') - monkeypatch.setenv(mlflow.environment_variables.MLFLOW_TRACKING_URI.name, 'databricks') + # Use a temporary directory instead of 'databricks' + tracking_uri = str(tmp_path / "mlruns") + monkeypatch.setenv(mlflow.environment_variables.MLFLOW_TRACKING_URI.name, tracking_uri) + os.makedirs(tracking_uri, exist_ok=True)