Skip to content

Commit 39d557c

Browse files
committed
Update tests
1 parent da737ae commit 39d557c

1 file changed

Lines changed: 18 additions & 24 deletions

File tree

climada/test/test_trajectories.py

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,7 @@
2525

2626
from climada.engine.impact_calc import ImpactCalc
2727
from climada.entity.disc_rates.base import DiscRates
28-
from climada.entity.impact_funcs.base import ImpactFunc
29-
from climada.entity.impact_funcs.impact_func_set import ImpactFuncSet
30-
from climada.test.conftest import (
31-
CATEGORIES,
32-
EXPOSURE_REF_YEAR,
33-
hazard_intensity_factory,
34-
)
28+
from climada.test.conftest import CATEGORIES, EXPOSURE_REF_YEAR
3529
from climada.trajectories import InterpolatedRiskTrajectory, StaticRiskTrajectory
3630
from climada.trajectories.constants import (
3731
AAI_METRIC_NAME,
@@ -55,7 +49,7 @@
5549
EXPOSURE_FUTURE_YEAR = 2040
5650

5751

58-
@pytest.fixture(scope="session")
52+
@pytest.fixture
5953
def snapshot_factory(
6054
exposures_factory,
6155
hazard_factory,
@@ -102,12 +96,12 @@ def _make_snapshot(
10296
return _make_snapshot
10397

10498

105-
@pytest.fixture(scope="session")
99+
@pytest.fixture
106100
def snapshot_base(snapshot_factory):
107101
return snapshot_factory()
108102

109103

110-
@pytest.fixture(scope="session")
104+
@pytest.fixture
111105
def snapshot_future(snapshot_factory):
112106
return snapshot_factory(
113107
date=2040,
@@ -463,7 +457,7 @@ def test_static_trajectory_risk_disc_rate(snapshot_base, snapshot_future):
463457
# ----------- INTERPOLATED TRAJ ----------------
464458

465459

466-
@pytest.fixture(scope="session")
460+
@pytest.fixture
467461
def snapshot_future_interp(snapshot_factory):
468462
return snapshot_factory(
469463
date=2022, # Closer date for less rows
@@ -472,7 +466,7 @@ def snapshot_future_interp(snapshot_factory):
472466
)
473467

474468

475-
@pytest.fixture(scope="session")
469+
@pytest.fixture
476470
def snapshot_future_interp_vulchange(snapshot_factory):
477471
return snapshot_factory(
478472
date=2022, # Closer date for less rows
@@ -482,15 +476,15 @@ def snapshot_future_interp_vulchange(snapshot_factory):
482476
)
483477

484478

485-
@pytest.fixture(scope="session")
479+
@pytest.fixture
486480
def snapshot_base_neg(snapshot_factory):
487481
return snapshot_factory(
488482
hazard_intensity_factor=-1.0,
489483
negative_intensities=True,
490484
)
491485

492486

493-
@pytest.fixture(scope="session")
487+
@pytest.fixture
494488
def snapshot_future_interp_neg(snapshot_factory):
495489
return snapshot_factory(
496490
date=2022,
@@ -500,7 +494,7 @@ def snapshot_future_interp_neg(snapshot_factory):
500494
)
501495

502496

503-
@pytest.fixture(scope="session")
497+
@pytest.fixture
504498
def expected_interp_metrics():
505499
# fmt: off
506500
return pd.DataFrame.from_dict(
@@ -529,7 +523,7 @@ def expected_interp_metrics():
529523
# fmt: on
530524

531525

532-
@pytest.fixture(scope="session")
526+
@pytest.fixture
533527
def expected_interp_metrics_wgroup(expected_interp_metrics):
534528
return pd.concat(
535529
[
@@ -561,7 +555,7 @@ def expected_interp_metrics_wgroup(expected_interp_metrics):
561555
)
562556

563557

564-
@pytest.fixture(scope="session")
558+
@pytest.fixture
565559
def expected_period_metrics():
566560
# fmt: off
567561
return pd.DataFrame.from_dict(
@@ -579,7 +573,7 @@ def expected_period_metrics():
579573
# fmt: on
580574

581575

582-
@pytest.fixture(scope="session")
576+
@pytest.fixture
583577
def expected_interp_period_wgroup(expected_period_metrics):
584578
return pd.concat(
585579
[
@@ -603,7 +597,7 @@ def expected_interp_period_wgroup(expected_period_metrics):
603597
)
604598

605599

606-
@pytest.fixture(scope="session")
600+
@pytest.fixture
607601
def expected_interp_metrics_rpchange():
608602
# fmt: off
609603
return pd.DataFrame.from_dict(
@@ -632,7 +626,7 @@ def expected_interp_metrics_rpchange():
632626
# fmt: on
633627

634628

635-
@pytest.fixture(scope="session")
629+
@pytest.fixture
636630
def expected_period_metrics_rpchange():
637631
# fmt: off
638632
return pd.DataFrame.from_dict(
@@ -650,7 +644,7 @@ def expected_period_metrics_rpchange():
650644
# fmt: on
651645

652646

653-
@pytest.fixture(scope="session")
647+
@pytest.fixture
654648
def expected_interp_metrics_ratechange():
655649
# fmt: off
656650
return pd.DataFrame.from_dict(
@@ -679,7 +673,7 @@ def expected_interp_metrics_ratechange():
679673
# fmt: on
680674

681675

682-
@pytest.fixture(scope="session")
676+
@pytest.fixture
683677
def expected_period_metrics_ratechange():
684678
# fmt: off
685679
return pd.DataFrame.from_dict(
@@ -697,7 +691,7 @@ def expected_period_metrics_ratechange():
697691
# fmt: on
698692

699693

700-
@pytest.fixture(scope="session")
694+
@pytest.fixture
701695
def expected_interp_metrics_contributions():
702696
return pd.DataFrame.from_dict(
703697
# fmt: off
@@ -726,7 +720,7 @@ def expected_interp_metrics_contributions():
726720
)
727721

728722

729-
@pytest.fixture(scope="session")
723+
@pytest.fixture
730724
def expected_interp_metrics_contributions_vulchange():
731725
return pd.DataFrame.from_dict(
732726
# fmt: off

0 commit comments

Comments
 (0)