From 5f9b1a952367deb05ce3eabc0f1de7458d3b76ef Mon Sep 17 00:00:00 2001 From: Paul Natsuo Kishimoto Date: Thu, 16 Nov 2023 16:35:21 +0100 Subject: [PATCH] Test warnings from DeprecatedPathFinder --- ixmp/tests/test_util.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ixmp/tests/test_util.py b/ixmp/tests/test_util.py index 5e78edcc6..98a7fd1ed 100644 --- a/ixmp/tests/test_util.py +++ b/ixmp/tests/test_util.py @@ -11,6 +11,16 @@ from ixmp.testing import make_dantzig, populate_test_platform +class TestDeprecatedPathFinder: + def test_import(self): + with pytest.warns( + DeprecationWarning, + match="Importing from 'ixmp.reporting.computations' is deprecated and will " + "fail in a future version. Use 'ixmp.report.operator'.", + ): + import ixmp.reporting.computations # type: ignore # noqa: F401 + + def test_check_year(): # If y is a string value, raise a Value Error.