Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: run channel tests with and without cache
Browse files Browse the repository at this point in the history
JoepVanlier committed Oct 4, 2024
1 parent b14ffc8 commit 77101ae
Showing 2 changed files with 27 additions and 3 deletions.
12 changes: 12 additions & 0 deletions lumicks/pylake/tests/test_channels/conftest.py
Original file line number Diff line number Diff line change
@@ -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)
18 changes: 15 additions & 3 deletions lumicks/pylake/tests/test_file/conftest.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 77101ae

Please sign in to comment.