From ab189a18a98e74c23e86d9ff7fb05992faebc21a Mon Sep 17 00:00:00 2001 From: dberenbaum Date: Mon, 3 Jul 2023 16:48:26 -0400 Subject: [PATCH] cleanup dvcyaml --- src/dvclive/live.py | 3 +++ tests/test_main.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/dvclive/live.py b/src/dvclive/live.py index d70b6a23..86b36a98 100644 --- a/src/dvclive/live.py +++ b/src/dvclive/live.py @@ -121,6 +121,9 @@ def _init_cleanup(self): if f and os.path.exists(f): os.remove(f) + if self.dvc_file and os.path.exists(self.dvc_file): + os.remove(self.dvc_file) + def _init_dvc(self): from dvc.scm import NoSCM diff --git a/tests/test_main.py b/tests/test_main.py index 62a2c8a2..8fecfbaf 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -171,6 +171,7 @@ def test_cleanup(tmp_dir, html): assert (tmp_dir / dvclive.plots_dir / Metric.subfolder / "m1.tsv").is_file() assert (tmp_dir / dvclive.metrics_file).is_file() + assert (tmp_dir / dvclive.dvc_file).is_file() assert html_path.is_file() == html dvclive = Live("logs") @@ -178,6 +179,7 @@ def test_cleanup(tmp_dir, html): assert (tmp_dir / "logs" / "some_user_file.txt").is_file() assert not (tmp_dir / dvclive.plots_dir / Metric.subfolder).exists() assert not (tmp_dir / dvclive.metrics_file).is_file() + assert not (tmp_dir / dvclive.dvc_file).is_file() assert not (html_path).is_file()