From d975445cdb324ae343cb1a50acbbec8503332612 Mon Sep 17 00:00:00 2001 From: Steph Prince <40640337+stephprince@users.noreply.github.com> Date: Thu, 15 Aug 2024 14:43:05 -0700 Subject: [PATCH] fix text decoding in test --- tests/unit/test_io_hdf5_h5tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test_io_hdf5_h5tools.py b/tests/unit/test_io_hdf5_h5tools.py index 1b641f6c6..fdfe95e8c 100644 --- a/tests/unit/test_io_hdf5_h5tools.py +++ b/tests/unit/test_io_hdf5_h5tools.py @@ -168,7 +168,7 @@ def test_write_dataset_lol_strings(self): a = [['aa', 'bb'], ['cc', 'dd']] self.io.write_dataset(self.f, DatasetBuilder('test_dataset', a, attributes={})) dset = self.f['test_dataset'] - decoded_dset = [[item.decode('utf-8') for item in sublist if isinstance(item, bytes)] + decoded_dset = [[item.decode('utf-8') if isinstance(item, bytes) else item for item in sublist] for sublist in dset[:]] self.assertTrue(decoded_dset == a)