diff --git a/orangecontrib/spectroscopy/tests/test_owmultifile.py b/orangecontrib/spectroscopy/tests/test_owmultifile.py index 642d31d56..545c4e415 100644 --- a/orangecontrib/spectroscopy/tests/test_owmultifile.py +++ b/orangecontrib/spectroscopy/tests/test_owmultifile.py @@ -22,6 +22,16 @@ wns_to_unique_str, decimals_neeeded_for_unique_str +class ReadImaginaryFile(SPAReader): + read_count = -1 + + def read_spectra(self): + type(self).read_count += 1 + if type(self).read_count == 0: + return np.array([1, 2]), np.array([[42, 41]]), None + return np.array([1, 2 + 1e-10]), np.array([[43, 44]]), None + + class TestOWFilesAuxiliary(unittest.TestCase): def test_numpy_union(self): @@ -233,15 +243,6 @@ def read_spectra(self): def test_spectra_almost_same_wavenumbers(self): - class ReadImaginaryFile(SPAReader): - read_count = -1 - - def read_spectra(self): - type(self).read_count += 1 - if type(self).read_count == 0: - return np.array([1, 2]), np.array([[42, 41]]), None - return np.array([1, 2 + 1e-10]), np.array([[43, 44]]), None - with patch.object(FileFormat, "registry", {"SPAReader": ReadImaginaryFile}): # clear LRU cache so that new classes get use FileFormat._ext_to_attr_if_attr2.cache_clear()