From 441f5c8999ef83b2a84af2f5de7b8831a15d7495 Mon Sep 17 00:00:00 2001 From: Pablo Brubeck Date: Mon, 13 Apr 2026 22:23:26 +0100 Subject: [PATCH] Test IrksomeImportOrderException --- tests/test_import_order.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/test_import_order.py diff --git a/tests/test_import_order.py b/tests/test_import_order.py new file mode 100644 index 00000000..f4698836 --- /dev/null +++ b/tests/test_import_order.py @@ -0,0 +1,17 @@ +import pytest + + +def test_wrong_import_order(): + from firedrake import UnitIntervalMesh, assemble, dx + mesh = UnitIntervalMesh(2) + assemble(1*dx(domain=mesh)) + + # the best we can do is to check for Exception + # because we cannot import IrksomeImportOrderException + # after firedrake without raising the exception + # or before firedrake without preventing the failure. + with pytest.raises(Exception): + import irksome # noqa F401 + + with pytest.raises(Exception): + from irksome import Dt # noqa F401