Skip to content

Commit 567638c

Browse files
authored
Clean up the log folder created by TaskLogger in unit test (#1086)
1 parent c4b763b commit 567638c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/unit/framework/test_tasks.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import logging
2+
import shutil
23
from pathlib import Path
34
from unittest.mock import create_autospec
45

@@ -103,9 +104,18 @@ def mock_migrate_external_tables_sync(cfg, workspace_client, sql_backend, instal
103104
cfg = WorkspaceConfig("test_db", log_level="INFO")
104105

105106
# test the task function is called
107+
install_dir = Path("foo")
106108
run_task(
107-
args, Path("foo"), cfg, create_autospec(WorkspaceClient), create_autospec(RuntimeBackend), MockInstallation()
109+
args,
110+
install_dir,
111+
cfg,
112+
create_autospec(WorkspaceClient),
113+
create_autospec(RuntimeBackend),
114+
MockInstallation(),
108115
)
116+
# clean up the log folder created by TaskLogger
117+
shutil.rmtree(install_dir)
118+
109119
assert "This mock task of migrate-tables" in capsys.readouterr().out
110120

111121
# test KeyError if task not found

0 commit comments

Comments
 (0)