Skip to content

Commit

Permalink
Replace with a more idiomatic test
Browse files Browse the repository at this point in the history
  • Loading branch information
mdickinson committed Jun 28, 2024
1 parent 4f8f916 commit 15fe026
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apptools/persistence/tests/test_state_pickler.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def verify(self, obj, state):
base64.decodebytes(data[num_attr]["data"])
)
num = pickle.loads(junk)
self.assertEqual(numpy.all(numpy.ravel(num == obj.numeric)), 1)
numpy.testing.assert_array_equal(num, obj.numeric, strict=True)

self.assertIn(data["ref"]["type"], ["reference", "numeric"])
if data["ref"]["type"] == "numeric":
Expand Down Expand Up @@ -218,7 +218,7 @@ def verify_unpickled(self, obj, state):
self.assertEqual(dct["ref"].__metadata__["type"], "instance")

num = state.numeric
self.assertEqual(numpy.all(numpy.ravel(num == obj.numeric)), 1)
numpy.testing.assert_array_equal(num, obj.numeric, strict=True)
self.assertEqual(id(state.ref), id(num))

if TVTK_AVAILABLE:
Expand Down

0 comments on commit 15fe026

Please sign in to comment.