Skip to content

Commit

Permalink
Improve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
iguinn committed Oct 25, 2024
1 parent a23e104 commit c9cf860
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/types/test_histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)])
Expand All @@ -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)))

0 comments on commit c9cf860

Please sign in to comment.