Skip to content

Commit 678f291

Browse files
committed
Match specific error message in test
1 parent a3823ed commit 678f291

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tests/test_wind_turbine.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,12 @@ def test_wrongly_defined_to_group_method(self):
9999
e_t_1.to_group(5, 3000)
100100

101101
def test_create_unphysical_turbine(self):
102+
err_msg = "1/2rotor_diameter cannot be greater than hub_height"
102103
char = {
103104
'hub_height': 80,
104105
'rotor_diameter': 160,
105106
'turbine_type': 'DUMMY 3',
106107
'path': self.source
107108
}
108-
with pytest.raises(ValueError):
109+
with pytest.raises(ValueError, match=err_msg):
109110
WindTurbine(**char)

windpowerlib/wind_turbine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def __init__(self, hub_height, nominal_power=None, path='oedb',
165165

166166
if self.rotor_diameter:
167167
if self.hub_height <= 0.5*self.rotor_diameter:
168-
msg = "1/2*rotor_diameter cannot be higher than hub_height"
168+
msg = "1/2rotor_diameter cannot be greater than hub_height"
169169
raise ValueError(msg)
170170

171171
if self.power_curve is None and self.power_coefficient_curve is None:

0 commit comments

Comments
 (0)