Skip to content

Commit 462923d

Browse files
committed
Adapt exception test to new function
Due to the changes in the function the error type changed. We could think of catching the error beforehand.
1 parent 77c1d6c commit 462923d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/test_power_output.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,11 @@ def test_power_curve_10(self):
215215
power_curve(**self.parameters2), self.power_output_exp2
216216
)
217217

218-
# Raise TypeErrors due to wrong type of `density_correction`
219-
with pytest.raises(TypeError):
220-
parameters["density"] = "wrong_type"
221-
power_curve(**parameters)
218+
def test_power_curve_11(self):
219+
"""Raise IndexErrors due to wrong type of `density_correction`"""
220+
with pytest.raises(IndexError, match="too many indices for array"):
221+
self.parameters2["density"] = "wrong_type"
222+
power_curve(**self.parameters2)
222223

223224
def test_power_curve_density_correction(self):
224225
"""TODO: Explain and split this test."""

0 commit comments

Comments
 (0)