0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-14 11:41:49 +02:00

fix: test_bec_monitor.py config loaded fresh in the test function to avoid parameter leak

This commit is contained in:
wyzula-jan
2023-10-30 17:31:59 +01:00
committed by wyzula_j
parent 989cd51162
commit 3866d7ce4d
4 changed files with 36 additions and 32 deletions

View File

@ -10,14 +10,14 @@ from bec_lib.core import RedisConnector
from bec_widgets.examples.stream_plot.stream_plot import StreamPlot
@pytest.fixture
@pytest.fixture(scope="function")
def stream_app(qtbot):
"""Helper function to set up the StreamPlot widget."""
client = mock.MagicMock()
widget = StreamPlot(client=client)
qtbot.addWidget(widget)
qtbot.waitExposed(widget)
return widget
yield widget
def test_roi_signals_emitted(qtbot, stream_app):
@ -126,6 +126,10 @@ def test_on_dap_update(qtbot, stream_app):
np.testing.assert_array_equal(stream_app.img.image, expected_data)
####################
# Until Here
####################
# def test_new_proj(qtbot, stream_app): #TODO this test is not working, does it make sense testing even?
# # Create some mock content to be "received" by the slot
# content_dict = {"signals": {"proj_nr": 1}}