From ba20222903f9e856a68e343f6a566fe683994ca1 Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Thu, 4 Jul 2024 16:29:15 +0100 Subject: [PATCH] Fix equality check in TVTK-related test (#352) Closes #305. Ideally we'd install Mayavi into the test environment in the test workflows, but I think that's too much of a maintenance risk. It would be even better to find a way to remove the TVTK-specific specializations altogether. --- apptools/persistence/tests/test_state_pickler.py | 4 +++- docs/releases/upcoming/352.bugfix.rst | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 docs/releases/upcoming/352.bugfix.rst diff --git a/apptools/persistence/tests/test_state_pickler.py b/apptools/persistence/tests/test_state_pickler.py index d0de88d9..8cdd41f4 100644 --- a/apptools/persistence/tests/test_state_pickler.py +++ b/apptools/persistence/tests/test_state_pickler.py @@ -251,7 +251,9 @@ def verify_state(self, state1, state): ).__metadata__["id"] if TVTK_AVAILABLE: - self.assertEqual(state1._tvtk, state._tvtk) + # Some of the values are NumPy arrays, so use NumPy's + # assert_equal instead of the unittest assertEqual. + numpy.testing.assert_equal(state1._tvtk, state._tvtk) state1.tuple[-1].__metadata__["id"] = state.tuple[-1].__metadata__[ "id" diff --git a/docs/releases/upcoming/352.bugfix.rst b/docs/releases/upcoming/352.bugfix.rst new file mode 100644 index 00000000..9ec16e4e --- /dev/null +++ b/docs/releases/upcoming/352.bugfix.rst @@ -0,0 +1 @@ +Fix a test that was broken in the presence of Mayavi / TVTK. (#352)