From c9cf860103e43fd984cc41a6b7ac2232b46bf26c Mon Sep 17 00:00:00 2001 From: iguinn Date: Fri, 25 Oct 2024 14:00:18 -0700 Subject: [PATCH] Improve test coverage --- tests/types/test_histogram.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/types/test_histogram.py b/tests/types/test_histogram.py index 7f983e1..4a57b99 100644 --- a/tests/types/test_histogram.py +++ b/tests/types/test_histogram.py @@ -375,6 +375,8 @@ def test_histogram_fill(): assert np.all( h.weights.nda == np.array([[0.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]) ) + with pytest.raises(ValueError, match="length of all data arrays"): + h.fill([np.array([1, 2, -1]), np.array([1, 2, 2, -1])]) # Test ordered dict of columnar data h = Histogram(None, [(0, 3, 1), (0, 3, 1)]) @@ -385,3 +387,8 @@ def test_histogram_fill(): assert np.all( h.weights.nda == np.array([[0.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]) ) + with pytest.raises(ValueError, match="length of all data arrays"): + h.fill({"a": [1, 2, -1], "b": [1, 2, 2, -1]}, keys=["a", "b"]) + + with pytest.raises(ValueError, match="data must be"): + h.fill(np.ones(shape=(5, 5)))