From 4935ab9cdaa6a9dfa353789c5f3fd373f73c3df1 Mon Sep 17 00:00:00 2001 From: Oliver Ruebel Date: Thu, 11 Jan 2024 00:50:54 -0800 Subject: [PATCH] Remove test case with system-dependent warning message --- tests/unit/test_zarrdataio.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/tests/unit/test_zarrdataio.py b/tests/unit/test_zarrdataio.py index 8e732201..0fc2f88c 100644 --- a/tests/unit/test_zarrdataio.py +++ b/tests/unit/test_zarrdataio.py @@ -98,28 +98,21 @@ def test_hdf5_to_zarr_filters_bitshuffle(self): @unittest.skipIf(not HDF5PLUGIN, "hdf5_plugin not installed") def test_hdf5_to_zarr_filters_other_unsupported(self): - """Test that we warn when other unsupported filter is used in HDF5 in ZarrDataIO.hdf5_to_zarr_filters.""" + """ + Test that we warn when an unsupported filter is used in HDF5 with ZarrDataIO.hdf5_to_zarr_filters. + This test is to ensure that the catch-all at the end of the loop works. + """ # Create a test HDF5 dataset with scaleoffset h5file = h5py.File(self.hdf_filename, mode='a') h5dset_FciDecomp = h5file.create_dataset( name='test_fcidecomp', data=[1, 2, 3, 4, 5], **hdf5plugin.FciDecomp()) - h5dset_SZ3 = h5file.create_dataset( - name='test_sz3', - data=[1, 2, 3, 4, 5], - **hdf5plugin.SZ3(absolute=0.1)) # test that we warn due to the FciDecomp msg = "/test_fcidecomp HDF5 filter id 32018 with properties None ignored in Zarr." with self.assertWarnsWith(UserWarning, msg): filters = ZarrDataIO.hdf5_to_zarr_filters(h5dset_FciDecomp) self.assertEqual(len(filters), 0) - # test that we warn due to the SZ3 - msg = ("/test_sz3 HDF5 filter id 32024 with properties " - "(1, 9, 0, 5, 0, 1069128089, 2576980378, 0, 0, 0, 0, 0, 0) ignored in Zarr.") - with self.assertWarnsWith(UserWarning, msg): - filters = ZarrDataIO.hdf5_to_zarr_filters(h5dset_SZ3) - self.assertEqual(len(filters), 0) # Close the HDF5 file h5file.close()