|
101 | 101 | _uname = platform.uname() |
102 | 102 |
|
103 | 103 | #: 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. |
104 | 107 | 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 | + ), |
105 | 115 | "pytest#10843": pytest.mark.xfail( |
106 | 116 | condition=GHA |
107 | 117 | and _uname.system == "Windows" |
108 | 118 | and ("2025" in _uname.release or _uname.version >= "10.0.26100"), |
109 | 119 | reason="https://github.com/pytest-dev/pytest/issues/10843", |
110 | | - ) |
| 120 | + ), |
111 | 121 | } |
112 | 122 |
|
113 | 123 | # Pytest hooks |
@@ -180,10 +190,21 @@ def pytest_generate_tests(metafunc: pytest.Metafunc) -> None: |
180 | 190 | if "backend" in metafunc.fixturenames: |
181 | 191 | import ixmp.backend |
182 | 192 |
|
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"]) |
185 | 206 |
|
186 | | - metafunc.parametrize("backend", sorted(set(ba) & markers) or ba, indirect=True) |
| 207 | + metafunc.parametrize("backend", argvalues, indirect=True) |
187 | 208 |
|
188 | 209 |
|
189 | 210 | # Session-scoped fixtures |
|
0 commit comments