Skip to content

Commit 65cfbae

Browse files
committed
Mark tests that fail without ixmp4 py3.14 support
- Add mark 'ixmp4_209' used/handled in iiasa/ixmp#602.
1 parent 525dcc6 commit 65cfbae

23 files changed

+57
-7
lines changed

message_ix/tests/model/message/test_cap_comm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
if TYPE_CHECKING:
1212
from ixmp import Platform
1313

14+
pytestmark = pytest.mark.ixmp4_209
1415

1516
COMMON: dict[str, int | str] = dict(
1617
commodity="coal",

message_ix/tests/model/test_message.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
if TYPE_CHECKING:
1414
from ixmp import Platform
1515

16+
pytestmark = pytest.mark.ixmp4_209
17+
1618
#: Periods: one historical, two in the time horizon
1719
Y = [0, 10, 20]
1820

message_ix/tests/report/test_operator.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import matplotlib
66
import pandas as pd
77
import pyam
8+
import pytest
89
from dask.core import literal
910

1011
try:
@@ -25,6 +26,7 @@
2526
# NOTE These tests likely don't need to be parametrized
2627

2728

29+
@pytest.mark.ixmp4_209
2830
def test_as_message_df(test_mp: "Platform") -> None:
2931
q = random_qty(dict(c=3, h=2, nl=5))
3032
q.units = "kg"
@@ -84,6 +86,7 @@ def test_as_message_df(test_mp: "Platform") -> None:
8486
assert q.size == len(s.par("demand"))
8587

8688

89+
@pytest.mark.ixmp4_209
8790
def test_as_pyam(message_test_mp: "Platform") -> None:
8891
scen = Scenario(message_test_mp, **SCENARIO["dantzig"])
8992
if not scen.has_solution():
@@ -101,6 +104,7 @@ def test_as_pyam(message_test_mp: "Platform") -> None:
101104
assert isinstance(p, pyam.IamDataFrame)
102105

103106

107+
@pytest.mark.ixmp4_209
104108
def test_concat(dantzig_reporter: Reporter) -> None:
105109
"""pyam.concat() correctly passes through to ixmp…concat()."""
106110
rep = dantzig_reporter

message_ix/tests/test_core.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
from message_ix import Scenario
1818
from message_ix.testing import GHA, SCENARIO, make_dantzig, make_westeros
1919

20+
pytestmark = pytest.mark.ixmp4_209
21+
2022

2123
@pytest.fixture
2224
def dantzig_message_scenario(
@@ -393,7 +395,7 @@ def test_add_cat_unique(message_test_mp: ixmp.Platform) -> None:
393395
assert [1963] == scen2.cat("year", "firstmodelyear")
394396

395397

396-
def test_years_active(test_mp: ixmp.Platform) -> None:
398+
def test_years_active0(test_mp: ixmp.Platform) -> None:
397399
test_mp.add_unit("year")
398400
scen = Scenario(test_mp, **SCENARIO["dantzig"], version="new")
399401
scen.add_set("node", "foo")
@@ -439,7 +441,7 @@ def test_years_active(test_mp: ixmp.Platform) -> None:
439441
npt.assert_array_equal(result, years[1:-1])
440442

441443

442-
def test_years_active_extend(message_test_mp: ixmp.Platform) -> None:
444+
def test_years_active1(message_test_mp: ixmp.Platform) -> None:
443445
scen = Scenario(message_test_mp, **SCENARIO["dantzig multi-year"])
444446

445447
# Existing time horizon
@@ -464,7 +466,7 @@ def test_years_active_extend(message_test_mp: ixmp.Platform) -> None:
464466
npt.assert_array_equal(result, years[1:-1])
465467

466468

467-
def test_years_active_extended2(test_mp: ixmp.Platform) -> None:
469+
def test_years_active2(test_mp: ixmp.Platform) -> None:
468470
test_mp.add_unit("year")
469471
scen = Scenario(test_mp, **SCENARIO["dantzig"], version="new")
470472
scen.add_set("node", "foo")
@@ -511,7 +513,7 @@ def test_years_active_extended2(test_mp: ixmp.Platform) -> None:
511513
npt.assert_array_equal(result, years[-2])
512514

513515

514-
def test_years_active_extend3(test_mp: ixmp.Platform) -> None:
516+
def test_years_active3(test_mp: ixmp.Platform) -> None:
515517
test_mp.add_unit("year")
516518
scen = Scenario(test_mp, **SCENARIO["dantzig"], version="new")
517519
scen.add_set("node", "foo")

message_ix/tests/test_feature_addon.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import numpy as np
22
import pandas as pd
3+
import pytest
34
from ixmp import Platform
45

56
from message_ix import Scenario
67
from message_ix.testing import SCENARIO
78

9+
pytestmark = pytest.mark.ixmp4_209
10+
811
# First model year of the Dantzig scenario
912
_year = 1963
1013

message_ix/tests/test_feature_bound_activity_shares.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
from message_ix import ModelError, Scenario, make_df
1212
from message_ix.testing import make_dantzig
1313

14+
pytestmark = pytest.mark.ixmp4_209
15+
1416
#: First model year of the :func:`.make_dantzig` scenario.
1517
Y0 = 1963
1618

message_ix/tests/test_feature_bound_emission.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
import pytest
12
from ixmp import Platform
23

34
from message_ix import Scenario
45

6+
pytestmark = pytest.mark.ixmp4_209
7+
58

69
def model_setup(scen: Scenario, years: list[int]) -> None:
710
scen.add_set("node", "node")

message_ix/tests/test_feature_capacity_factor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
from message_ix import ModelError, Scenario
77
from message_ix.testing import make_subannual
88

9+
pytestmark = pytest.mark.ixmp4_209
10+
911

1012
def check_solution(scen: Scenario) -> None:
1113
"""Perform several assertions about the solution of `scen`."""

message_ix/tests/test_feature_duration_time.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@
88

99
from itertools import product
1010

11+
import pytest
1112
from ixmp import Platform
1213

1314
from message_ix import Scenario
1415

16+
pytestmark = pytest.mark.ixmp4_209
17+
1518

1619
# A function for generating a simple model with sub-annual time slices
1720
def model_generator(

message_ix/tests/test_feature_price_commodity.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
from message_ix import ModelError, Scenario
55

6+
pytestmark = pytest.mark.ixmp4_209
7+
68

79
def model_setup(scen: Scenario, var_cost: int | None = 1) -> None:
810
scen.add_set("node", "node")

0 commit comments

Comments
 (0)