From 9e17e46305644e74126e3fcb04eb307580d73c8c Mon Sep 17 00:00:00 2001 From: Paul Natsuo Kishimoto Date: Mon, 30 Oct 2023 15:18:38 +0100 Subject: [PATCH] Mark test_{from_url,get_remove_ts} as Xfail with ixmp 3.4.0 --- message_ix_models/tests/report/test_compat.py | 2 +- message_ix_models/tests/report/test_computations.py | 4 ++++ message_ix_models/tests/test_report.py | 12 ++++++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/message_ix_models/tests/report/test_compat.py b/message_ix_models/tests/report/test_compat.py index a23319ca6f..670777ddac 100644 --- a/message_ix_models/tests/report/test_compat.py +++ b/message_ix_models/tests/report/test_compat.py @@ -16,7 +16,7 @@ from ..test_report import MARK, ss_reporter -@MARK[0] +@MARK[1] def test_compat(tmp_path, test_context): import numpy.testing as npt diff --git a/message_ix_models/tests/report/test_computations.py b/message_ix_models/tests/report/test_computations.py index 0f8cd68c70..ed775b2d16 100644 --- a/message_ix_models/tests/report/test_computations.py +++ b/message_ix_models/tests/report/test_computations.py @@ -24,6 +24,8 @@ share_curtailment, ) +from ..test_report import MARK + @pytest.fixture def c() -> Computer: @@ -76,6 +78,7 @@ def test_filter_ts(): assert {"ar"} == set(result.variable.unique()) +@MARK[0] def test_from_url(scenario): full_url = f"ixmp://{scenario.platform.name}/{scenario.url}" @@ -92,6 +95,7 @@ def test_from_url(scenario): assert scenario.url == result.url +@MARK[0] def test_get_remove_ts(caplog, scenario): # get_ts() runs result0 = get_ts(scenario) diff --git a/message_ix_models/tests/test_report.py b/message_ix_models/tests/test_report.py index 379374fa72..2c2cb3d159 100644 --- a/message_ix_models/tests/test_report.py +++ b/message_ix_models/tests/test_report.py @@ -20,6 +20,10 @@ } MARK = ( + pytest.mark.xfail( + condition=version("message_ix") < "3.5", + reason="Not supported with message_ix < 3.5", + ), pytest.mark.xfail( condition=version("message_ix") < "3.6", raises=NotImplementedError, @@ -44,7 +48,7 @@ def _cb(*args): register(_cb) -@MARK[0] +@MARK[1] def test_report_bare_res(request, test_context): """Prepare and run the standard MESSAGE-GLOBIOM reporting on a bare RES.""" scenario = testing.bare_res(request, test_context, solved=True) @@ -124,7 +128,7 @@ def test_report_legacy(caplog, request, tmp_path, test_context): ) -@MARK[0] +@MARK[1] @pytest.mark.parametrize("regions", ["R11"]) def test_apply_units(request, test_context, regions): test_context.regions = regions @@ -242,7 +246,7 @@ def ss_reporter(): return rep -@MARK[0] +@MARK[1] def test_add_simulated_solution(test_context, test_data_path): # Simulated solution can be added to an empty Reporter rep = ss_reporter() @@ -270,7 +274,7 @@ def test_add_simulated_solution(test_context, test_data_path): assert np.isclose(79.76478, value.item()) -@MARK[0] +@MARK[1] def test_prepare_reporter(test_context): rep = ss_reporter() N = len(rep.graph)