Skip to content

Commit

Permalink
fix tmp_dir for test on windows and macos
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreKempf committed Feb 9, 2024
1 parent 40686c7 commit e30f6f1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_system_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ def test_get_cpus_metrics(mocker, metric_name):
(2.0, 1, True),
],
)
def test_cpumetricscallback_with_plot(duration, interval, plot, tmpdir):
def test_cpumetricscallback_with_plot(tmp_dir, duration, interval, plot):
with Live(
tmpdir,
tmp_dir,
save_dvc_exp=False,
callbacks=[CPUMetricsCallback(duration, interval, plot)],
) as live:
Expand All @@ -84,7 +84,7 @@ def test_cpumetricscallback_with_plot(duration, interval, plot, tmpdir):
assert "read_speed_MB" in latest["system"]["io"]
assert "write_speed_MB" in latest["system"]["io"]

prefix = f"{tmpdir}/plots/metrics/system"
prefix = f"{tmp_dir}/plots/metrics/system"
assert f"{prefix}/cpu/usage_avg_percent.tsv" in history
assert f"{prefix}/cpu/usage_max_percent.tsv" in history
assert f"{prefix}/cpu/parallelism_percent.tsv" in history
Expand All @@ -104,9 +104,9 @@ def test_cpumetricscallback_with_plot(duration, interval, plot, tmpdir):
(2.0, 1, False),
],
)
def test_cpumetricscallback_without_plot(duration, interval, plot, tmpdir):
def test_cpumetricscallback_without_plot(tmp_dir, duration, interval, plot):
with Live(
tmpdir,
tmp_dir,
save_dvc_exp=False,
callbacks=[CPUMetricsCallback(duration, interval, plot)],
) as live:
Expand All @@ -127,7 +127,7 @@ def test_cpumetricscallback_without_plot(duration, interval, plot, tmpdir):
assert "read_speed_MB" in latest["system"]["io"]
assert "write_speed_MB" in latest["system"]["io"]

prefix = f"{tmpdir}/plots/metrics/system"
prefix = f"{tmp_dir}/plots/metrics/system"
assert f"{prefix}/cpu/usage_avg_percent.tsv" not in history
assert f"{prefix}/cpu/usage_max_percent.tsv" not in history
assert f"{prefix}/cpu/count.tsv" not in history
Expand Down

0 comments on commit e30f6f1

Please sign in to comment.