Skip to content

Commit

Permalink
fix conftest.py
Browse files Browse the repository at this point in the history
Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
  • Loading branch information
WeichenXu123 committed Nov 29, 2021
1 parent 0ad527e commit 2ea29c6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 2ea29c6

Please sign in to comment.