Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrakenhoff committed Jan 28, 2025
1 parent 403fa85 commit e8f5ef2
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions tests/test_003_pastastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def test_create_models(pstore):
["oseries1", "oseries2"], store=True, progressbar=False
)
_ = pstore.conn.models
assert pstore.n_models == 2


@pytest.mark.dependency
Expand Down Expand Up @@ -252,15 +253,12 @@ def test_update_ts_settings(request, pstore):

ml2 = pstore.get_models(ml.name, update_ts_settings=True)

try:
assert ml2.oseries.settings["tmax"] == o.index[-1]
assert ml2.stressmodels["recharge"].prec.settings["tmax"] == tmax
assert ml2.stressmodels["recharge"].evap.settings["tmax"] == tmax
assert ml2.stressmodels["prec"].stress[0].settings["tmax"] == p2.index[-1]
except AssertionError:
pstore.del_models("ml_oseries2")
pstore.set_check_model_series_values(True)
raise
assert ml2.oseries.settings["tmax"] == o.index[-1]
assert ml2.stressmodels["recharge"].prec.settings["tmax"] == tmax
assert ml2.stressmodels["recharge"].evap.settings["tmax"] == tmax
assert ml2.stressmodels["prec"].stress[0].settings["tmax"] == p2.index[-1]
pstore.del_models("ml_oseries2")
pstore.set_check_model_series_values(True)


# @pytest.mark.dependency()
Expand Down Expand Up @@ -323,7 +321,8 @@ def test_meta_with_name(pstore):

@pytest.mark.dependency
def test_models_metadata(request, pstore):
depends(request, [f"test_create_models[{pstore.type}]"])
# depends(request, [f"test_create_models[{pstore.type}]"])
pstore.create_models_bulk(["oseries1", "oseries2"], store=True, progressbar=False)
df = pstore.models.metadata
assert df.index.size == 2
assert (df["n_stressmodels"] == 1).all()

0 comments on commit e8f5ef2

Please sign in to comment.