From 676064630264b15cda6c05a6d0af06adc9ea36c2 Mon Sep 17 00:00:00 2001
From: David Schaefer <david.schaefer@ufz.de>
Date: Tue, 17 Jan 2023 14:38:12 +0100
Subject: [PATCH] fix plotting test

---
 tests/funcs/test_tools.py | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/tests/funcs/test_tools.py b/tests/funcs/test_tools.py
index 8ec0b5262..6c63f5ec4 100644
--- a/tests/funcs/test_tools.py
+++ b/tests/funcs/test_tools.py
@@ -2,6 +2,8 @@
 #
 # SPDX-License-Identifier: GPL-3.0-or-later
 
+from pathlib import Path
+
 import numpy as np
 import pandas as pd
 import pytest
@@ -11,7 +13,7 @@ import saqc
 
 
 @pytest.mark.slow
-def test_makeFig():
+def test_makeFig(tmp_path):
     # just testing for no errors to occure...
     data = dios.DictOfSeries(
         pd.Series(
@@ -28,11 +30,11 @@ def test_makeFig():
     )
 
     # not interactive, no storing
-    dummy_path = ""
+    outfile = str(Path(tmp_path, "test.png"))  # the filesystem's temp dir
 
-    d_saqc = d_saqc.plot(field="data", path="")
-    d_saqc = d_saqc.plot(field="data", path=dummy_path, history="valid", stats=True)
-    d_saqc = d_saqc.plot(field="data", path=dummy_path, history="complete")
+    d_saqc = d_saqc.plot(field="data", path=outfile)
+    d_saqc = d_saqc.plot(field="data", path=outfile, history="valid", stats=True)
+    d_saqc = d_saqc.plot(field="data", path=outfile, history="complete")
     d_saqc = d_saqc.plot(
-        field="data", path=dummy_path, ax_kwargs={"ylabel": "data is data"}, stats=True
+        field="data", path=outfile, ax_kwargs={"ylabel": "data is data"}, stats=True
     )
-- 
GitLab