From ad4ae08193856b4ffa89784586a52897276015aa Mon Sep 17 00:00:00 2001
From: David Schaefer <david.schaefer@ufz.de>
Date: Mon, 11 Mar 2024 16:29:32 +0100
Subject: [PATCH] fixed tests

---
 CHANGELOG.md               | 4 ++--
 tests/core/test_history.py | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index b45ee4ee4..8207d7a88 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,12 +13,12 @@ SPDX-License-Identifier: GPL-3.0-or-later
 - Option to change the flagging scheme after initialization
 - `flagByClick`: manually assign flags using a graphical user interface
 - `SaQC`: support for selection, slicing and setting of items by use of subscription on SaQC objects (e.g. `qc[key]` and `qc[key] = value`).
-   Selection works with single keys, collections of keys and string slices (e.g. `qc["a":"f"]`).  Values can be SaQC objects, pd.Series, 
+   Selection works with single keys, collections of keys and string slices (e.g. `qc["a":"f"]`).  Values can be SaQC objects, pd.Series,
    Iterable of Series and dict-like with series values.
 - `transferFlags` is a multivariate function
 - `plot`: added `yscope` keyword
 - `setFlags`: function to replace `flagManual`
-- `flagUniLOF`: added defaultly applied correction to mitigate phenomenon of overflagging at relatively steep data value slopes. (parameter `slope_correct`). 
+- `flagUniLOF`: added defaultly applied correction to mitigate phenomenon of overflagging at relatively steep data value slopes. (parameter `slope_correct`).
 - `History`: added option to change aggregation behavior
 ### Changed
 ### Removed
diff --git a/tests/core/test_history.py b/tests/core/test_history.py
index 319a47fe9..dd6243d87 100644
--- a/tests/core/test_history.py
+++ b/tests/core/test_history.py
@@ -251,13 +251,13 @@ def test_append_force(__hist, s, max_val):
         (pd.Series(4, index=range(6), dtype=float), {"last": 4, "min": 0, "max": 6}),
     ],
 )
-def test_aggregations(__hist, col, expected):
+def test_aggregations(__hist, col, expected, hist=History(index=pd.Index(range(6)))):
     import saqc.core.history
-
-    hist = __hist
     hist.append(col)
     check_invariants(hist)
     for aggregation in ["last", "min", "max"]:
         saqc.core.history.AGGREGATION = aggregation
-        hist._aggregation = aggregation
         assert (hist.squeeze() == expected[aggregation]).all()
+
+    # reset to not disturb the other tests...
+    saqc.core.history.AGGREGATION = "last"
-- 
GitLab