Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove mlruns directory in module teardown #5120

Merged
merged 6 commits into from Nov 30, 2021
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions tests/conftest.py
@@ -1,5 +1,6 @@
import os
import inspect
import shutil
from unittest import mock

import pytest
Expand Down Expand Up @@ -96,3 +97,14 @@ def new_exception(msg, *_, **__):
yield
else:
yield


@pytest.fixture(autouse=True, scope="module")
def clean_up_mlruns_direcotry(request):
"""
Clean up an `mlruns` directory on each test module teardown.
"""
yield
mlruns_dir = os.path.join(request.config.rootpath, "mlruns")
if os.path.exists(mlruns_dir):
shutil.rmtree(mlruns_dir)
harupy marked this conversation as resolved.
Show resolved Hide resolved