From 76e551c9eaed0cbaab4b5b9a2b9fecaf9ada64b9 Mon Sep 17 00:00:00 2001 From: Jim Pivarski Date: Tue, 20 Sep 2022 11:26:22 -0500 Subject: [PATCH] test: adjust for boost-histogram 1.3.2's _storage_type deprecation. (#719) * test: adjust for boost-histogram 1.3.2's _storage_type deprecation. * Include fallback because the matrix of which version has what is complicated. --- tests/test_0350-read-RooCurve-RooHist.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/test_0350-read-RooCurve-RooHist.py b/tests/test_0350-read-RooCurve-RooHist.py index 9928369bf..51cf6f6f3 100644 --- a/tests/test_0350-read-RooCurve-RooHist.py +++ b/tests/test_0350-read-RooCurve-RooHist.py @@ -107,10 +107,17 @@ def test_to_boost(roohist, roocurve, roocurve_err): rc_boost = roocurve.to_boost(rh_boost.axes[0].edges) assert (rc_boost.axes[0].edges == rh_boost.axes[0].edges).all() - assert rc_boost._storage_type == boost_histogram.storage.Double + if hasattr(rc_boost, "storage_type"): + assert rc_boost.storage_type == boost_histogram.storage.Double + else: + assert rc_boost._storage_type == boost_histogram.storage.Double + rc_boost = roocurve.to_boost(rh_boost.axes[0].edges, error_curve=roocurve_err) assert (rc_boost.axes[0].edges == rh_boost.axes[0].edges).all() - assert rc_boost._storage_type == boost_histogram.storage.Weight + if hasattr(rc_boost, "storage_type"): + assert rc_boost.storage_type == boost_histogram.storage.Weight + else: + assert rc_boost._storage_type == boost_histogram.storage.Weight def test_interpolate(roocurve, roocurve_err):