From b5ce3c5b26ea716e0084b9d1f2744e8e7c0e2f60 Mon Sep 17 00:00:00 2001 From: rly Date: Mon, 2 Oct 2023 23:03:43 -0700 Subject: [PATCH] Rename test DCI class to avoid pickup by pytest --- .../unit/utils_test/test_core_GenericDataChunkIterator.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unit/utils_test/test_core_GenericDataChunkIterator.py b/tests/unit/utils_test/test_core_GenericDataChunkIterator.py index f05a295f8..debac9cab 100644 --- a/tests/unit/utils_test/test_core_GenericDataChunkIterator.py +++ b/tests/unit/utils_test/test_core_GenericDataChunkIterator.py @@ -20,7 +20,7 @@ TQDM_INSTALLED = False -class TestPickleableNumpyArrayDataChunkIterator(GenericDataChunkIterator): +class PickleableNumpyArrayDataChunkIterator(GenericDataChunkIterator): def __init__(self, array: np.ndarray, **kwargs): self.array = array self._kwargs = kwargs @@ -41,7 +41,7 @@ def _to_dict(self) -> dict: @staticmethod def _from_dict(dictionary: dict) -> Callable: array = pickle.loads(dictionary["array"]) - return TestPickleableNumpyArrayDataChunkIterator(array=array, **dictionary["kwargs"]) + return PickleableNumpyArrayDataChunkIterator(array=array, **dictionary["kwargs"]) class GenericDataChunkIteratorTests(TestCase): @@ -428,10 +428,10 @@ def test_tqdm_not_installed(self): self.assertFalse(dci.display_progress) def test_pickle(self): - pre_dump_iterator = TestPickleableNumpyArrayDataChunkIterator(array=self.test_array) + pre_dump_iterator = PickleableNumpyArrayDataChunkIterator(array=self.test_array) post_dump_iterator = pickle.loads(pickle.dumps(pre_dump_iterator)) - assert isinstance(post_dump_iterator, TestPickleableNumpyArrayDataChunkIterator) + assert isinstance(post_dump_iterator, PickleableNumpyArrayDataChunkIterator) assert post_dump_iterator.chunk_shape == pre_dump_iterator.chunk_shape assert post_dump_iterator.buffer_shape == pre_dump_iterator.buffer_shape assert_array_equal(post_dump_iterator.array, pre_dump_iterator.array)