diff --git a/lumicks/pylake/tests/test_channels/conftest.py b/lumicks/pylake/tests/test_channels/conftest.py index cf01d6b4a..2a66370e3 100644 --- a/lumicks/pylake/tests/test_channels/conftest.py +++ b/lumicks/pylake/tests/test_channels/conftest.py @@ -31,3 +31,15 @@ def channel_h5_file(tmpdir_factory, request): mock_file.make_continuous_channel("Photon count", "Red", np.int64(20e9), freq, counts) return mock_file.file + + +@pytest.fixture(autouse=True, scope="module", params=[False, True]) +def cache_setting(request): + from lumicks.pylake.channel import global_cache, set_cache_enabled + + old_value = global_cache + try: + set_cache_enabled(request.param) + yield + finally: + set_cache_enabled(old_value) diff --git a/lumicks/pylake/tests/test_file/conftest.py b/lumicks/pylake/tests/test_file/conftest.py index d6dbb809c..cb3287b0a 100644 --- a/lumicks/pylake/tests/test_file/conftest.py +++ b/lumicks/pylake/tests/test_file/conftest.py @@ -15,9 +15,9 @@ 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 8, 0]) infowave = np.uint8([1, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 0, 2, - 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 0, 2, - 1, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 0, 2, - 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 0, 2]) + 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 0, 2, + 1, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 0, 2, + 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 0, 2]) # fmt: on @@ -259,3 +259,15 @@ def h5_two_colors(tmpdir_factory, request): mock_file.make_continuous_channel("Photon count", "Blue", np.int64(20e9), freq, counts) mock_file.make_continuous_channel("Info wave", "Info wave", np.int64(20e9), freq, infowave) return mock_file.file + + +@pytest.fixture(autouse=True, scope="module", params=[False, True]) +def cache_setting(request): + from lumicks.pylake.channel import global_cache, set_cache_enabled + + old_value = global_cache + try: + set_cache_enabled(request.param) + yield + finally: + set_cache_enabled(old_value)