From e612dd0b388d844f7a5a394f9b92169e9e1d4203 Mon Sep 17 00:00:00 2001 From: David de la Iglesia Castro Date: Thu, 2 Sep 2021 11:47:53 +0200 Subject: [PATCH] Updated html_path --- dvclive/metrics.py | 2 +- tests/test_main.py | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/dvclive/metrics.py b/dvclive/metrics.py index 480cf417..778c009f 100644 --- a/dvclive/metrics.py +++ b/dvclive/metrics.py @@ -98,7 +98,7 @@ def summary_path(self): @property def html_path(self): - return self.dir + ".html" + return self.dir + "_dvc_plots/index.html" @property def step(self): diff --git a/tests/test_main.py b/tests/test_main.py index bfdc8299..9f2ca78a 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -125,24 +125,27 @@ def test_html(tmp_dir, dvc_repo, html, signal_exists, monkeypatch): [(True, True), (True, False), (False, True), (False, False)], ) def test_cleanup(tmp_dir, summary, html): - dvclive.init("logs", summary=summary) + logger = dvclive.init("logs", summary=summary) dvclive.log("m1", 1) dvclive.next_step() + + html_path = tmp_dir / logger.html_path if html: - (tmp_dir / "logs.html").touch() + html_path.parent.mkdir() + html_path.touch() (tmp_dir / "logs" / "some_user_file.txt").touch() assert (tmp_dir / "logs" / "m1.tsv").is_file() assert (tmp_dir / "logs.json").is_file() == summary - assert (tmp_dir / "logs.html").is_file() == html + assert html_path.is_file() == html dvclive.init("logs") assert (tmp_dir / "logs" / "some_user_file.txt").is_file() assert not (tmp_dir / "logs" / "m1.tsv").is_file() assert not (tmp_dir / "logs.json").is_file() - assert not (tmp_dir / "logs.html").is_file() + assert not (html_path).is_file() @pytest.mark.parametrize(