Skip to content

Commit 6099375

Browse files
committed
1 parent 7123d1d commit 6099375

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

ixmp/testing/__init__.py

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,23 @@
101101
_uname = platform.uname()
102102

103103
#: Pytest marks for use throughout the test suite.
104+
#:
105+
#: - ``ixmp4#209``: https://github.com/iiasa/ixmp4/pull/209,
106+
#: https://github.com/unionai-oss/pandera/pull/2158.
104107
MARK = {
108+
"IXMP4Backend NI": pytest.mark.xfail(
109+
reason="Not implemented on IXMP4Backend",
110+
),
111+
"ixmp4#209": pytest.mark.xfail(
112+
condition=platform.python_version_tuple() >= ("3", "14", "0"),
113+
reason="ixmp4 (pandera) do not yet support Python 3.14",
114+
),
105115
"pytest#10843": pytest.mark.xfail(
106116
condition=GHA
107117
and _uname.system == "Windows"
108118
and ("2025" in _uname.release or _uname.version >= "10.0.26100"),
109119
reason="https://github.com/pytest-dev/pytest/issues/10843",
110-
)
120+
),
111121
}
112122

113123
# Pytest hooks
@@ -180,10 +190,21 @@ def pytest_generate_tests(metafunc: pytest.Metafunc) -> None:
180190
if "backend" in metafunc.fixturenames:
181191
import ixmp.backend
182192

183-
ba = ixmp.backend.available()
184-
markers = set(m.name for m in metafunc.definition.iter_markers())
193+
# All available backends
194+
argvalues: list[Any] = sorted(ixmp.backend.available())
195+
196+
# Names of markers applied to the test function
197+
marker_names = set(m.name for m in metafunc.definition.iter_markers())
198+
199+
if "ixmp4" in argvalues:
200+
i = argvalues.index("ixmp4")
201+
if "jdbc" in marker_names:
202+
# This marker actually means "not implemented/supported on IXMP4"
203+
argvalues[i] = pytest.param("ixmp4", marks=MARK["IXMP4Backend NI"])
204+
elif "ixmp4_209" in marker_names:
205+
argvalues[i] = pytest.param("ixmp4", marks=MARK["ixmp4#209"])
185206

186-
metafunc.parametrize("backend", sorted(set(ba) & markers) or ba, indirect=True)
207+
metafunc.parametrize("backend", argvalues, indirect=True)
187208

188209

189210
# Session-scoped fixtures

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ markers = [
152152
"performance: ixmp performance test.",
153153
"jdbc: tests exclusive to JDBCBackend.",
154154
"ixmp4: tests exclusive to IXMP4Backend.",
155+
"ixmp4_209: https://github.com/iiasa/ixmp4/pull/209",
155156
]
156157
tmp_path_retention_policy = "none"
157158
usefixtures = "tmp_env"

0 commit comments

Comments
 (0)