Skip to content

Commit bcbdcd2

Browse files
committed
Fixes tests
1 parent 7a73c87 commit bcbdcd2

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

climada/test/test_trajectories.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ def setUp(self) -> None:
6363
)
6464

6565
self.expected_base_imp = ImpactCalc(
66-
**self.base_snapshot.impact_calc_data
66+
**self.base_snapshot.impact_calc_kwargs
6767
).impact()
6868
self.expected_future_imp = ImpactCalc(
69-
**self.future_snapshot.impact_calc_data
69+
**self.future_snapshot.impact_calc_kwargs
7070
).impact()
7171
self.expected_base_return_period_impacts = {
7272
rp: imp
@@ -149,15 +149,15 @@ def test_static_trajectory_with_group(self):
149149
exposure=exp0,
150150
hazard=reusable_minimal_hazard(),
151151
impfset=reusable_minimal_impfset(),
152-
date=self.PRESENT_DATE,
152+
date=str(self.PRESENT_DATE),
153153
)
154154
snap1 = Snapshot(
155155
exposure=exp1,
156156
hazard=reusable_minimal_hazard(
157157
intensity_factor=self.HAZ_INCREASE_INTENSITY_FACTOR
158158
),
159159
impfset=reusable_minimal_impfset(),
160-
date=self.FUTURE_DATE,
160+
date=str(self.FUTURE_DATE),
161161
)
162162

163163
expected_static_metrics = pd.concat(

climada/trajectories/test/test_calc_risk_metrics.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,10 @@ def test_set_impact_computation_strategy(self):
250250
assert self.calc.impact_computation_strategy == mock_strat
251251

252252
def test_set_impact_computation_strategy_wtype(self):
253-
with pytest.raises(ValueError, match="Not an impact computation strategy"):
253+
with pytest.raises(
254+
ValueError,
255+
match="The provided value is not an ImpactComputationStrategy object",
256+
):
254257
self.calc.impact_computation_strategy = "NotAStrategy"
255258

256259
@patch.object(CalcRiskMetricsPoints, "impact_computation_strategy")

0 commit comments

Comments
 (0)