From 1b9a56f4d5396222a79f8ece50a67cd95eb27143 Mon Sep 17 00:00:00 2001 From: David Perl Date: Thu, 5 Feb 2026 11:23:57 +0100 Subject: [PATCH] wip --- tests/unit_tests/client_mocks.py | 225 ----------------- tests/unit_tests/conftest.py | 232 +++++++++++++++++- tests/unit_tests/test_abort_button.py | 2 - tests/unit_tests/test_axis_settings.py | 1 - tests/unit_tests/test_bec_connector.py | 2 - tests/unit_tests/test_bec_queue.py | 2 - tests/unit_tests/test_bec_status_box.py | 2 - tests/unit_tests/test_busy_loader.py | 2 - tests/unit_tests/test_color_utils.py | 1 - tests/unit_tests/test_crosshair.py | 1 - tests/unit_tests/test_curve_settings.py | 5 +- tests/unit_tests/test_dap_combobox.py | 1 - tests/unit_tests/test_dark_mode_button.py | 2 +- tests/unit_tests/test_developer_view.py | 2 - tests/unit_tests/test_device_browser.py | 2 - ...test_device_initialization_progress_bar.py | 2 - tests/unit_tests/test_device_input_base.py | 1 - tests/unit_tests/test_device_input_widgets.py | 2 - .../test_device_manager_components.py | 2 - tests/unit_tests/test_device_manager_view.py | 2 - tests/unit_tests/test_device_signal_input.py | 1 - tests/unit_tests/test_dock_area.py | 2 - tests/unit_tests/test_filter_io.py | 1 - tests/unit_tests/test_heatmap_widget.py | 3 - tests/unit_tests/test_help_inspector.py | 2 - tests/unit_tests/test_image_roi_tree.py | 1 - tests/unit_tests/test_image_rois.py | 1 - tests/unit_tests/test_image_view_next_gen.py | 1 - tests/unit_tests/test_launch_window.py | 2 - tests/unit_tests/test_lmfit_dialog.py | 1 - tests/unit_tests/test_logpanel.py | 2 - tests/unit_tests/test_main_app.py | 2 - tests/unit_tests/test_main_widnow.py | 1 - tests/unit_tests/test_monaco_dock.py | 2 - tests/unit_tests/test_monaco_editor.py | 1 - tests/unit_tests/test_motor_map_next_gen.py | 1 - .../test_multi_waveform_next_gen.py | 1 - tests/unit_tests/test_notifications.py | 2 - tests/unit_tests/test_pdf_viewer.py | 2 - tests/unit_tests/test_plot_base_next_gen.py | 1 - tests/unit_tests/test_positioner_box.py | 1 - tests/unit_tests/test_positioner_box_2d.py | 1 - tests/unit_tests/test_reset_button.py | 2 - tests/unit_tests/test_resume_button.py | 2 - tests/unit_tests/test_ring_progress_bar.py | 2 - .../unit_tests/test_ring_progress_bar_ring.py | 2 - .../unit_tests/test_ring_progress_settings.py | 1 - tests/unit_tests/test_rpc_server.py | 2 - tests/unit_tests/test_scan_control.py | 2 - tests/unit_tests/test_scan_history_browser.py | 2 - tests/unit_tests/test_scan_progress_bar.py | 2 - tests/unit_tests/test_scatter_waveform.py | 1 - tests/unit_tests/test_signal_label.py | 2 - tests/unit_tests/test_stop_button.py | 2 - tests/unit_tests/test_text_box_widget.py | 2 - .../unit_tests/test_utils_bec_signal_proxy.py | 1 - .../unit_tests/test_utils_plot_indicators.py | 2 - tests/unit_tests/test_waveform.py | 8 - tests/unit_tests/test_web_console.py | 2 - tests/unit_tests/test_website_widget.py | 2 - 60 files changed, 230 insertions(+), 332 deletions(-) delete mode 100644 tests/unit_tests/client_mocks.py diff --git a/tests/unit_tests/client_mocks.py b/tests/unit_tests/client_mocks.py deleted file mode 100644 index 80c056dc..00000000 --- a/tests/unit_tests/client_mocks.py +++ /dev/null @@ -1,225 +0,0 @@ -# pylint: disable = no-name-in-module,missing-class-docstring, missing-module-docstring -from math import inf -from unittest.mock import MagicMock, PropertyMock, patch - -import fakeredis -import pytest -from bec_lib.bec_service import messages -from bec_lib.endpoints import MessageEndpoints -from bec_lib.scan_history import ScanHistory - -from bec_widgets.tests.utils import FakePositioner, Positioner - - -@pytest.fixture(scope="function") -def mocked_client(bec_dispatcher): - - # Ensure isinstance check for Positioner passes - original_isinstance = isinstance - - def isinstance_mock(obj, class_info): - if class_info == Positioner and isinstance(obj, FakePositioner): - return True - return original_isinstance(obj, class_info) - - with patch("builtins.isinstance", new=isinstance_mock): - yield bec_dispatcher.client - bec_dispatcher.client.connector.shutdown() - - -################################################## -# Client Fixture with DAP -################################################## -@pytest.fixture(scope="function") -def dap_plugin_message(): - msg = messages.AvailableResourceMessage( - **{ - "resource": { - "GaussianModel": { - "class": "LmfitService1D", - "user_friendly_name": "GaussianModel", - "class_doc": "A model based on a Gaussian or normal distribution lineshape.\n\n The model has three Parameters: `amplitude`, `center`, and `sigma`.\n In addition, parameters `fwhm` and `height` are included as\n constraints to report full width at half maximum and maximum peak\n height, respectively.\n\n .. math::\n\n f(x; A, \\mu, \\sigma) = \\frac{A}{\\sigma\\sqrt{2\\pi}} e^{[{-{(x-\\mu)^2}/{{2\\sigma}^2}}]}\n\n where the parameter `amplitude` corresponds to :math:`A`, `center` to\n :math:`\\mu`, and `sigma` to :math:`\\sigma`. The full width at half\n maximum is :math:`2\\sigma\\sqrt{2\\ln{2}}`, approximately\n :math:`2.3548\\sigma`.\n\n For more information, see: https://en.wikipedia.org/wiki/Normal_distribution\n\n ", - "run_doc": "A model based on a Gaussian or normal distribution lineshape.\n\n The model has three Parameters: `amplitude`, `center`, and `sigma`.\n In addition, parameters `fwhm` and `height` are included as\n constraints to report full width at half maximum and maximum peak\n height, respectively.\n\n .. math::\n\n f(x; A, \\mu, \\sigma) = \\frac{A}{\\sigma\\sqrt{2\\pi}} e^{[{-{(x-\\mu)^2}/{{2\\sigma}^2}}]}\n\n where the parameter `amplitude` corresponds to :math:`A`, `center` to\n :math:`\\mu`, and `sigma` to :math:`\\sigma`. The full width at half\n maximum is :math:`2\\sigma\\sqrt{2\\ln{2}}`, approximately\n :math:`2.3548\\sigma`.\n\n For more information, see: https://en.wikipedia.org/wiki/Normal_distribution\n\n \n Args:\n scan_item (ScanItem): Scan item or scan ID\n device_x (DeviceBase | str): Device name for x\n signal_x (DeviceBase | str): Signal name for x\n device_y (DeviceBase | str): Device name for y\n signal_y (DeviceBase | str): Signal name for y\n parameters (dict): Fit parameters\n ", - "run_name": "fit", - "signature": [ - { - "name": "args", - "kind": "VAR_POSITIONAL", - "default": "_empty", - "annotation": "_empty", - }, - { - "name": "scan_item", - "kind": "KEYWORD_ONLY", - "default": None, - "annotation": "ScanItem | str", - }, - { - "name": "device_x", - "kind": "KEYWORD_ONLY", - "default": None, - "annotation": "DeviceBase | str", - }, - { - "name": "signal_x", - "kind": "KEYWORD_ONLY", - "default": None, - "annotation": "DeviceBase | str", - }, - { - "name": "device_y", - "kind": "KEYWORD_ONLY", - "default": None, - "annotation": "DeviceBase | str", - }, - { - "name": "signal_y", - "kind": "KEYWORD_ONLY", - "default": None, - "annotation": "DeviceBase | str", - }, - { - "name": "parameters", - "kind": "KEYWORD_ONLY", - "default": None, - "annotation": "dict", - }, - { - "name": "kwargs", - "kind": "VAR_KEYWORD", - "default": "_empty", - "annotation": "_empty", - }, - ], - "auto_fit_supported": True, - "params": { - "amplitude": { - "name": "amplitude", - "value": 1.0, - "vary": True, - "min": -inf, - "max": inf, - "expr": None, - "brute_step": None, - "user_data": None, - }, - "center": { - "name": "center", - "value": 0.0, - "vary": True, - "min": -inf, - "max": inf, - "expr": None, - "brute_step": None, - "user_data": None, - }, - "sigma": { - "name": "sigma", - "value": 1.0, - "vary": True, - "min": 0, - "max": inf, - "expr": None, - "brute_step": None, - "user_data": None, - }, - "fwhm": { - "name": "fwhm", - "value": 2.35482, - "vary": False, - "min": -inf, - "max": inf, - "expr": "2.3548200*sigma", - "brute_step": None, - "user_data": None, - }, - "height": { - "name": "height", - "value": 0.3989423, - "vary": False, - "min": -inf, - "max": inf, - "expr": "0.3989423*amplitude/max(1e-15, sigma)", - "brute_step": None, - "user_data": None, - }, - }, - "class_args": [], - "class_kwargs": {"model": "GaussianModel"}, - } - } - } - ) - yield msg - - -@pytest.fixture(scope="function") -def mocked_client_with_dap(mocked_client, dap_plugin_message): - dap_services = { - "BECClient": messages.StatusMessage(name="BECClient", status=1, info={}), - "DAPServer/LmfitService1D": messages.StatusMessage( - name="LmfitService1D", status=1, info={} - ), - } - type(mocked_client).service_status = PropertyMock(return_value=dap_services) - mocked_client.connector.set( - topic=MessageEndpoints.dap_available_plugins("dap"), msg=dap_plugin_message - ) - - # Patch the client's DAP attribute so that the available models include "GaussianModel" - patched_models = {"GaussianModel": {}, "LorentzModel": {}, "SineModel": {}} - mocked_client.dap._available_dap_plugins = patched_models - - yield mocked_client - - -class DummyData: - def __init__(self, val, timestamps): - self.val = val - self.timestamps = timestamps - - def get(self, key, default=None): - if key == "val": - return self.val - return default - - -def create_dummy_scan_item(): - """ - Helper to create a dummy scan item with both live_data and metadata/status_message info. - """ - dummy_live_data = { - "samx": {"samx": DummyData(val=[10, 20, 30], timestamps=[100, 200, 300])}, - "samy": {"samy": DummyData(val=[5, 10, 15], timestamps=[100, 200, 300])}, - "bpm4i": {"bpm4i": DummyData(val=[5, 6, 7], timestamps=[101, 201, 301])}, - "async_device": {"async_device": DummyData(val=[1, 2, 3], timestamps=[11, 21, 31])}, - } - dummy_scan = MagicMock() - dummy_scan.live_data = dummy_live_data - dummy_scan.metadata = { - "bec": { - "scan_id": "dummy", - "scan_report_devices": ["samx"], - "readout_priority": {"monitored": ["bpm4i"], "async": ["async_device"]}, - } - } - dummy_scan.status_message.info = { - "readout_priority": {"monitored": ["bpm4i"], "async": ["async_device"]}, - "scan_report_devices": ["samx"], - } - return dummy_scan - - -def inject_scan_history(widget, scan_history_factory, *history_args): - """ - Helper to inject scan history messages into client history. - """ - history_msgs = [] - for scan_id, scan_number in history_args: - history_msgs.append(scan_history_factory(scan_id=scan_id, scan_number=scan_number)) - widget.client.history = ScanHistory(widget.client, False) - for msg in history_msgs: - widget.client.history._scan_data[msg.scan_id] = msg - widget.client.history._scan_ids.append(msg.scan_id) - widget.client.queue.scan_storage.current_scan = None - return history_msgs diff --git a/tests/unit_tests/conftest.py b/tests/unit_tests/conftest.py index 3cf31e36..2e6dce74 100644 --- a/tests/unit_tests/conftest.py +++ b/tests/unit_tests/conftest.py @@ -1,7 +1,8 @@ import json import time +from math import inf from unittest import mock -from unittest.mock import patch +from unittest.mock import MagicMock, PropertyMock, patch import fakeredis import h5py @@ -10,7 +11,9 @@ import pytest from bec_lib import messages, service_config from bec_lib.bec_service import messages from bec_lib.client import BECClient +from bec_lib.endpoints import MessageEndpoints from bec_lib.messages import _StoredDataInfo +from bec_lib.scan_history import ScanHistory from bec_qthemes import apply_theme from ophyd._pyepics_shim import _dispatcher from pytestqt.exceptions import TimeoutError as QtBotTimeoutError @@ -18,7 +21,7 @@ from qtpy.QtCore import QEvent, QEventLoop from qtpy.QtWidgets import QApplication, QMessageBox from bec_widgets.cli.rpc.rpc_register import RPCRegister -from bec_widgets.tests.utils import DEVICES, DMMock +from bec_widgets.tests.utils import DEVICES, DMMock, FakePositioner, Positioner from bec_widgets.utils import bec_dispatcher as bec_dispatcher_module from bec_widgets.utils import error_popups from bec_widgets.utils.bec_dispatcher import QtRedisConnector @@ -38,8 +41,8 @@ def pytest_runtest_makereport(item, call): def process_all_deferred_deletes(qapp): - qapp.sendPostedEvents(None, QEvent.DeferredDelete) - qapp.processEvents(QEventLoop.AllEvents) + qapp.sendPostedEvents(None, QEvent.Type.DeferredDelete) + qapp.processEvents(QEventLoop.ProcessEventsFlag.AllEvents) @pytest.fixture(autouse=True) @@ -101,7 +104,6 @@ def mock_client(*_, **__): connector_cls=global_mock_qt_redis_connector, ) client.start() - client.device_manager.add_devices(DEVICES) return client @@ -374,3 +376,223 @@ def scan_history_factory(tmpdir): return create_history_file(file_path, data, metadata) return _factory + + +@pytest.fixture(scope="function") +def mocked_client(bec_dispatcher): + + # Ensure isinstance check for Positioner passes + original_isinstance = isinstance + + def isinstance_mock(obj, class_info): + if class_info == Positioner and isinstance(obj, FakePositioner): + return True + return original_isinstance(obj, class_info) + + with patch("builtins.isinstance", new=isinstance_mock): + yield bec_dispatcher.client + bec_dispatcher.client.connector.shutdown() + + +@pytest.fixture(scope="function") +def mock_client_w_devices(mocked_client): + mocked_client.device_manager.add_devices(DEVICES) + + +################################################## +# Client Fixture with DAP +################################################## +@pytest.fixture(scope="function") +def dap_plugin_message(): + msg = messages.AvailableResourceMessage( + **{ + "resource": { + "GaussianModel": { + "class": "LmfitService1D", + "user_friendly_name": "GaussianModel", + "class_doc": "A model based on a Gaussian or normal distribution lineshape.\n\n The model has three Parameters: `amplitude`, `center`, and `sigma`.\n In addition, parameters `fwhm` and `height` are included as\n constraints to report full width at half maximum and maximum peak\n height, respectively.\n\n .. math::\n\n f(x; A, \\mu, \\sigma) = \\frac{A}{\\sigma\\sqrt{2\\pi}} e^{[{-{(x-\\mu)^2}/{{2\\sigma}^2}}]}\n\n where the parameter `amplitude` corresponds to :math:`A`, `center` to\n :math:`\\mu`, and `sigma` to :math:`\\sigma`. The full width at half\n maximum is :math:`2\\sigma\\sqrt{2\\ln{2}}`, approximately\n :math:`2.3548\\sigma`.\n\n For more information, see: https://en.wikipedia.org/wiki/Normal_distribution\n\n ", + "run_doc": "A model based on a Gaussian or normal distribution lineshape.\n\n The model has three Parameters: `amplitude`, `center`, and `sigma`.\n In addition, parameters `fwhm` and `height` are included as\n constraints to report full width at half maximum and maximum peak\n height, respectively.\n\n .. math::\n\n f(x; A, \\mu, \\sigma) = \\frac{A}{\\sigma\\sqrt{2\\pi}} e^{[{-{(x-\\mu)^2}/{{2\\sigma}^2}}]}\n\n where the parameter `amplitude` corresponds to :math:`A`, `center` to\n :math:`\\mu`, and `sigma` to :math:`\\sigma`. The full width at half\n maximum is :math:`2\\sigma\\sqrt{2\\ln{2}}`, approximately\n :math:`2.3548\\sigma`.\n\n For more information, see: https://en.wikipedia.org/wiki/Normal_distribution\n\n \n Args:\n scan_item (ScanItem): Scan item or scan ID\n device_x (DeviceBase | str): Device name for x\n signal_x (DeviceBase | str): Signal name for x\n device_y (DeviceBase | str): Device name for y\n signal_y (DeviceBase | str): Signal name for y\n parameters (dict): Fit parameters\n ", + "run_name": "fit", + "signature": [ + { + "name": "args", + "kind": "VAR_POSITIONAL", + "default": "_empty", + "annotation": "_empty", + }, + { + "name": "scan_item", + "kind": "KEYWORD_ONLY", + "default": None, + "annotation": "ScanItem | str", + }, + { + "name": "device_x", + "kind": "KEYWORD_ONLY", + "default": None, + "annotation": "DeviceBase | str", + }, + { + "name": "signal_x", + "kind": "KEYWORD_ONLY", + "default": None, + "annotation": "DeviceBase | str", + }, + { + "name": "device_y", + "kind": "KEYWORD_ONLY", + "default": None, + "annotation": "DeviceBase | str", + }, + { + "name": "signal_y", + "kind": "KEYWORD_ONLY", + "default": None, + "annotation": "DeviceBase | str", + }, + { + "name": "parameters", + "kind": "KEYWORD_ONLY", + "default": None, + "annotation": "dict", + }, + { + "name": "kwargs", + "kind": "VAR_KEYWORD", + "default": "_empty", + "annotation": "_empty", + }, + ], + "auto_fit_supported": True, + "params": { + "amplitude": { + "name": "amplitude", + "value": 1.0, + "vary": True, + "min": -inf, + "max": inf, + "expr": None, + "brute_step": None, + "user_data": None, + }, + "center": { + "name": "center", + "value": 0.0, + "vary": True, + "min": -inf, + "max": inf, + "expr": None, + "brute_step": None, + "user_data": None, + }, + "sigma": { + "name": "sigma", + "value": 1.0, + "vary": True, + "min": 0, + "max": inf, + "expr": None, + "brute_step": None, + "user_data": None, + }, + "fwhm": { + "name": "fwhm", + "value": 2.35482, + "vary": False, + "min": -inf, + "max": inf, + "expr": "2.3548200*sigma", + "brute_step": None, + "user_data": None, + }, + "height": { + "name": "height", + "value": 0.3989423, + "vary": False, + "min": -inf, + "max": inf, + "expr": "0.3989423*amplitude/max(1e-15, sigma)", + "brute_step": None, + "user_data": None, + }, + }, + "class_args": [], + "class_kwargs": {"model": "GaussianModel"}, + } + } + } + ) + yield msg + + +@pytest.fixture(scope="function") +def mocked_client_with_dap(mocked_client, dap_plugin_message): + mocked_client.device_manager.add_devices(DEVICES) + dap_services = { + "BECClient": messages.StatusMessage(name="BECClient", status=1, info={}), + "DAPServer/LmfitService1D": messages.StatusMessage( + name="LmfitService1D", status=1, info={} + ), + } + type(mocked_client).service_status = PropertyMock(return_value=dap_services) + mocked_client.connector.set( + topic=MessageEndpoints.dap_available_plugins("dap"), msg=dap_plugin_message + ) + + # Patch the client's DAP attribute so that the available models include "GaussianModel" + patched_models = {"GaussianModel": {}, "LorentzModel": {}, "SineModel": {}} + mocked_client.dap._available_dap_plugins = patched_models + + yield mocked_client + + +class DummyData: + def __init__(self, val, timestamps): + self.val = val + self.timestamps = timestamps + + def get(self, key, default=None): + if key == "val": + return self.val + return default + + +def create_dummy_scan_item(): + """ + Helper to create a dummy scan item with both live_data and metadata/status_message info. + """ + dummy_live_data = { + "samx": {"samx": DummyData(val=[10, 20, 30], timestamps=[100, 200, 300])}, + "samy": {"samy": DummyData(val=[5, 10, 15], timestamps=[100, 200, 300])}, + "bpm4i": {"bpm4i": DummyData(val=[5, 6, 7], timestamps=[101, 201, 301])}, + "async_device": {"async_device": DummyData(val=[1, 2, 3], timestamps=[11, 21, 31])}, + } + dummy_scan = MagicMock() + dummy_scan.live_data = dummy_live_data + dummy_scan.metadata = { + "bec": { + "scan_id": "dummy", + "scan_report_devices": ["samx"], + "readout_priority": {"monitored": ["bpm4i"], "async": ["async_device"]}, + } + } + dummy_scan.status_message.info = { + "readout_priority": {"monitored": ["bpm4i"], "async": ["async_device"]}, + "scan_report_devices": ["samx"], + } + return dummy_scan + + +def inject_scan_history(widget, scan_history_factory, *history_args): + """ + Helper to inject scan history messages into client history. + """ + history_msgs = [] + for scan_id, scan_number in history_args: + history_msgs.append(scan_history_factory(scan_id=scan_id, scan_number=scan_number)) + widget.client.history = ScanHistory(widget.client, False) + for msg in history_msgs: + widget.client.history._scan_data[msg.scan_id] = msg + widget.client.history._scan_ids.append(msg.scan_id) + widget.client.queue.scan_storage.current_scan = None + return history_msgs diff --git a/tests/unit_tests/test_abort_button.py b/tests/unit_tests/test_abort_button.py index 44eb7698..6cc56098 100644 --- a/tests/unit_tests/test_abort_button.py +++ b/tests/unit_tests/test_abort_button.py @@ -6,8 +6,6 @@ import pytest from bec_widgets.widgets.control.buttons.button_abort.button_abort import AbortButton -from .client_mocks import mocked_client - @pytest.fixture def abort_button(qtbot, mocked_client): diff --git a/tests/unit_tests/test_axis_settings.py b/tests/unit_tests/test_axis_settings.py index 88acc04b..f84dfac8 100644 --- a/tests/unit_tests/test_axis_settings.py +++ b/tests/unit_tests/test_axis_settings.py @@ -3,7 +3,6 @@ from qtpy.QtWidgets import QDoubleSpinBox, QLineEdit from bec_widgets.widgets.plots.plot_base import PlotBase from bec_widgets.widgets.plots.setting_menus.axis_settings import AxisSettings -from tests.unit_tests.client_mocks import mocked_client from tests.unit_tests.conftest import create_widget diff --git a/tests/unit_tests/test_bec_connector.py b/tests/unit_tests/test_bec_connector.py index 4610fbc3..c7260500 100644 --- a/tests/unit_tests/test_bec_connector.py +++ b/tests/unit_tests/test_bec_connector.py @@ -9,8 +9,6 @@ from bec_widgets.utils import BECConnector from bec_widgets.utils.error_popups import SafeProperty from bec_widgets.utils.error_popups import SafeSlot as Slot -from .client_mocks import mocked_client - class BECConnectorQObject(BECConnector, QObject): ... diff --git a/tests/unit_tests/test_bec_queue.py b/tests/unit_tests/test_bec_queue.py index e3f0f7a1..be66043e 100644 --- a/tests/unit_tests/test_bec_queue.py +++ b/tests/unit_tests/test_bec_queue.py @@ -3,8 +3,6 @@ from bec_lib import messages from bec_widgets.widgets.services.bec_queue.bec_queue import BECQueue -from .client_mocks import mocked_client - @pytest.fixture def bec_queue_msg_full(): diff --git a/tests/unit_tests/test_bec_status_box.py b/tests/unit_tests/test_bec_status_box.py index 363602df..52fefd16 100644 --- a/tests/unit_tests/test_bec_status_box.py +++ b/tests/unit_tests/test_bec_status_box.py @@ -9,8 +9,6 @@ from bec_widgets.widgets.services.bec_status_box.bec_status_box import ( BECStatusBox, ) -from .client_mocks import mocked_client - @pytest.fixture def service_status_fixture(): diff --git a/tests/unit_tests/test_busy_loader.py b/tests/unit_tests/test_busy_loader.py index 0425c78b..67faa8dc 100644 --- a/tests/unit_tests/test_busy_loader.py +++ b/tests/unit_tests/test_busy_loader.py @@ -5,8 +5,6 @@ from qtpy.QtWidgets import QLabel, QVBoxLayout, QWidget from bec_widgets import BECWidget from bec_widgets.widgets.utility.spinner.spinner import SpinnerWidget -from .client_mocks import mocked_client - class _TestBusyWidget(BECWidget, QWidget): def __init__( diff --git a/tests/unit_tests/test_color_utils.py b/tests/unit_tests/test_color_utils.py index 39c46473..9dc77426 100644 --- a/tests/unit_tests/test_color_utils.py +++ b/tests/unit_tests/test_color_utils.py @@ -8,7 +8,6 @@ from bec_widgets.utils import Colors, ConnectionConfig from bec_widgets.utils.bec_widget import BECWidget from bec_widgets.utils.colors import apply_theme from bec_widgets.widgets.plots.waveform.curve import CurveConfig -from tests.unit_tests.client_mocks import mocked_client from tests.unit_tests.conftest import create_widget diff --git a/tests/unit_tests/test_crosshair.py b/tests/unit_tests/test_crosshair.py index 28662a27..7792aa6b 100644 --- a/tests/unit_tests/test_crosshair.py +++ b/tests/unit_tests/test_crosshair.py @@ -7,7 +7,6 @@ from qtpy.QtGui import QTransform from bec_widgets.utils import Crosshair from bec_widgets.widgets.plots.image.image_item import ImageItem from bec_widgets.widgets.plots.waveform.waveform import Waveform -from tests.unit_tests.client_mocks import mocked_client from .conftest import create_widget diff --git a/tests/unit_tests/test_curve_settings.py b/tests/unit_tests/test_curve_settings.py index 7c630bd2..e3753b38 100644 --- a/tests/unit_tests/test_curve_settings.py +++ b/tests/unit_tests/test_curve_settings.py @@ -12,7 +12,6 @@ from bec_widgets.widgets.plots.waveform.settings.curve_settings.curve_tree impor ScanIndexValidator, ) from bec_widgets.widgets.plots.waveform.waveform import Waveform -from tests.unit_tests.client_mocks import dap_plugin_message, mocked_client, mocked_client_with_dap from tests.unit_tests.conftest import create_widget ################################################## @@ -21,11 +20,11 @@ from tests.unit_tests.conftest import create_widget @pytest.fixture -def curve_setting_fixture(qtbot, mocked_client): +def curve_setting_fixture(qtbot, mock_client_w_devices): """ Creates a CurveSetting widget targeting a mock or real Waveform widget. """ - wf = create_widget(qtbot, Waveform, client=mocked_client) + wf = create_widget(qtbot, Waveform, client=mock_client_w_devices) wf.x_mode = "auto" curve_setting = create_widget(qtbot, CurveSetting, parent=None, target_widget=wf) return curve_setting, wf diff --git a/tests/unit_tests/test_dap_combobox.py b/tests/unit_tests/test_dap_combobox.py index 93cdfca0..e469837e 100644 --- a/tests/unit_tests/test_dap_combobox.py +++ b/tests/unit_tests/test_dap_combobox.py @@ -2,7 +2,6 @@ import pytest from bec_widgets.widgets.dap.dap_combo_box.dap_combo_box import DapComboBox -from .client_mocks import mocked_client from .conftest import create_widget diff --git a/tests/unit_tests/test_dark_mode_button.py b/tests/unit_tests/test_dark_mode_button.py index 59a20702..0903c8aa 100644 --- a/tests/unit_tests/test_dark_mode_button.py +++ b/tests/unit_tests/test_dark_mode_button.py @@ -7,7 +7,7 @@ from bec_widgets.utils.colors import apply_theme from bec_widgets.widgets.utility.visual.dark_mode_button.dark_mode_button import DarkModeButton # pylint: disable=unused-import -from .client_mocks import mocked_client + # pylint: disable=redefined-outer-name diff --git a/tests/unit_tests/test_developer_view.py b/tests/unit_tests/test_developer_view.py index f4b756fc..bee29f2f 100644 --- a/tests/unit_tests/test_developer_view.py +++ b/tests/unit_tests/test_developer_view.py @@ -22,8 +22,6 @@ from bec_widgets.widgets.editors.monaco.monaco_dock import MonacoDock from bec_widgets.widgets.editors.monaco.monaco_widget import MonacoWidget from bec_widgets.widgets.utility.ide_explorer.ide_explorer import IDEExplorer -from .client_mocks import mocked_client - @pytest.fixture def developer_view(qtbot, mocked_client): diff --git a/tests/unit_tests/test_device_browser.py b/tests/unit_tests/test_device_browser.py index f996d96a..6c1abb73 100644 --- a/tests/unit_tests/test_device_browser.py +++ b/tests/unit_tests/test_device_browser.py @@ -14,8 +14,6 @@ from bec_widgets.widgets.services.device_browser.device_item.device_signal_displ SignalDisplay, ) -from .client_mocks import mocked_client - if TYPE_CHECKING: # pragma: no cover from qtpy.QtWidgets import QListWidgetItem diff --git a/tests/unit_tests/test_device_initialization_progress_bar.py b/tests/unit_tests/test_device_initialization_progress_bar.py index 530b53c1..3e6b2b57 100644 --- a/tests/unit_tests/test_device_initialization_progress_bar.py +++ b/tests/unit_tests/test_device_initialization_progress_bar.py @@ -6,8 +6,6 @@ from bec_widgets.widgets.progress.device_initialization_progress_bar.device_init DeviceInitializationProgressBar, ) -from .client_mocks import mocked_client - @pytest.fixture def progress_bar(qtbot, mocked_client): diff --git a/tests/unit_tests/test_device_input_base.py b/tests/unit_tests/test_device_input_base.py index 52fac530..8cf4a808 100644 --- a/tests/unit_tests/test_device_input_base.py +++ b/tests/unit_tests/test_device_input_base.py @@ -11,7 +11,6 @@ from bec_widgets.widgets.control.device_input.base_classes.device_input_base imp ) from bec_widgets.widgets.control.device_input.device_combobox.device_combobox import DeviceComboBox -from .client_mocks import mocked_client from .conftest import create_widget diff --git a/tests/unit_tests/test_device_input_widgets.py b/tests/unit_tests/test_device_input_widgets.py index f394a297..94bf6423 100644 --- a/tests/unit_tests/test_device_input_widgets.py +++ b/tests/unit_tests/test_device_input_widgets.py @@ -7,8 +7,6 @@ from bec_widgets.widgets.control.device_input.device_line_edit.device_line_edit DeviceLineEdit, ) -from .client_mocks import mocked_client - @pytest.fixture def device_input_combobox(qtbot, mocked_client): diff --git a/tests/unit_tests/test_device_manager_components.py b/tests/unit_tests/test_device_manager_components.py index 771dc2df..c5057cf4 100644 --- a/tests/unit_tests/test_device_manager_components.py +++ b/tests/unit_tests/test_device_manager_components.py @@ -57,8 +57,6 @@ from bec_widgets.widgets.control.device_manager.components.ophyd_validation.vali ) from bec_widgets.widgets.utility.toggle.toggle import ToggleSwitch -from .client_mocks import mocked_client - class TestConstants: """Test class for constants and configuration values.""" diff --git a/tests/unit_tests/test_device_manager_view.py b/tests/unit_tests/test_device_manager_view.py index e7326c53..c151ee3d 100644 --- a/tests/unit_tests/test_device_manager_view.py +++ b/tests/unit_tests/test_device_manager_view.py @@ -43,8 +43,6 @@ from bec_widgets.widgets.control.device_manager.components.ophyd_validation.ophy OphydValidation, ) -from .client_mocks import mocked_client - @pytest.fixture def device_config() -> dict: diff --git a/tests/unit_tests/test_device_signal_input.py b/tests/unit_tests/test_device_signal_input.py index fbeb4551..af4da830 100644 --- a/tests/unit_tests/test_device_signal_input.py +++ b/tests/unit_tests/test_device_signal_input.py @@ -15,7 +15,6 @@ from bec_widgets.widgets.control.device_input.signal_line_edit.signal_line_edit SignalLineEdit, ) -from .client_mocks import mocked_client from .conftest import create_widget diff --git a/tests/unit_tests/test_dock_area.py b/tests/unit_tests/test_dock_area.py index 8b6a309d..46a2412b 100644 --- a/tests/unit_tests/test_dock_area.py +++ b/tests/unit_tests/test_dock_area.py @@ -40,8 +40,6 @@ from bec_widgets.widgets.containers.dock_area.settings.dialogs import ( ) from bec_widgets.widgets.containers.dock_area.settings.workspace_manager import WorkSpaceManager -from .client_mocks import mocked_client - @pytest.fixture def advanced_dock_area(qtbot, mocked_client): diff --git a/tests/unit_tests/test_filter_io.py b/tests/unit_tests/test_filter_io.py index e5087124..70f6c3cd 100644 --- a/tests/unit_tests/test_filter_io.py +++ b/tests/unit_tests/test_filter_io.py @@ -6,7 +6,6 @@ from bec_widgets.widgets.control.device_input.device_line_edit.device_line_edit ) from bec_widgets.widgets.dap.dap_combo_box.dap_combo_box import DapComboBox -from .client_mocks import mocked_client from .conftest import create_widget diff --git a/tests/unit_tests/test_heatmap_widget.py b/tests/unit_tests/test_heatmap_widget.py index fe8e0ee8..b665c9a5 100644 --- a/tests/unit_tests/test_heatmap_widget.py +++ b/tests/unit_tests/test_heatmap_widget.py @@ -16,9 +16,6 @@ from bec_widgets.widgets.plots.heatmap.heatmap import ( ) # pytest: disable=unused-import -from tests.unit_tests.client_mocks import mocked_client - -from .client_mocks import create_dummy_scan_item @pytest.fixture diff --git a/tests/unit_tests/test_help_inspector.py b/tests/unit_tests/test_help_inspector.py index 5ab96274..bd90d89e 100644 --- a/tests/unit_tests/test_help_inspector.py +++ b/tests/unit_tests/test_help_inspector.py @@ -9,8 +9,6 @@ from bec_widgets.utils.help_inspector.help_inspector import HelpInspector from bec_widgets.utils.widget_io import WidgetHierarchy from bec_widgets.widgets.control.buttons.button_abort.button_abort import AbortButton -from .client_mocks import mocked_client - @pytest.fixture def help_inspector(qtbot, mocked_client): diff --git a/tests/unit_tests/test_image_roi_tree.py b/tests/unit_tests/test_image_roi_tree.py index d00866b2..30970ede 100644 --- a/tests/unit_tests/test_image_roi_tree.py +++ b/tests/unit_tests/test_image_roi_tree.py @@ -7,7 +7,6 @@ from qtpy.QtCore import QPointF, Qt from bec_widgets.widgets.plots.image.image import Image from bec_widgets.widgets.plots.image.setting_widgets.image_roi_tree import ROIPropertyTree from bec_widgets.widgets.plots.roi.image_roi import CircularROI, RectangularROI -from tests.unit_tests.client_mocks import mocked_client from tests.unit_tests.conftest import create_widget diff --git a/tests/unit_tests/test_image_rois.py b/tests/unit_tests/test_image_rois.py index f667a37b..90e3b562 100644 --- a/tests/unit_tests/test_image_rois.py +++ b/tests/unit_tests/test_image_rois.py @@ -12,7 +12,6 @@ from bec_widgets.widgets.plots.roi.image_roi import ( RectangularROI, ROIController, ) -from tests.unit_tests.client_mocks import mocked_client from tests.unit_tests.conftest import create_widget diff --git a/tests/unit_tests/test_image_view_next_gen.py b/tests/unit_tests/test_image_view_next_gen.py index 6144468d..ebfc4503 100644 --- a/tests/unit_tests/test_image_view_next_gen.py +++ b/tests/unit_tests/test_image_view_next_gen.py @@ -5,7 +5,6 @@ from bec_lib.endpoints import MessageEndpoints from qtpy.QtCore import QPointF from bec_widgets.widgets.plots.image.image import Image -from tests.unit_tests.client_mocks import mocked_client from tests.unit_tests.conftest import create_widget ################################################## diff --git a/tests/unit_tests/test_launch_window.py b/tests/unit_tests/test_launch_window.py index 7967df65..b4bcb872 100644 --- a/tests/unit_tests/test_launch_window.py +++ b/tests/unit_tests/test_launch_window.py @@ -11,8 +11,6 @@ from bec_widgets.applications.launch_window import LaunchWindow from bec_widgets.widgets.containers.auto_update.auto_updates import AutoUpdates from bec_widgets.widgets.containers.main_window.main_window import BECMainWindow -from .client_mocks import mocked_client - base_path = os.path.dirname(bec_widgets.__file__) diff --git a/tests/unit_tests/test_lmfit_dialog.py b/tests/unit_tests/test_lmfit_dialog.py index 31d1418d..c21dbf91 100644 --- a/tests/unit_tests/test_lmfit_dialog.py +++ b/tests/unit_tests/test_lmfit_dialog.py @@ -5,7 +5,6 @@ import pytest from bec_widgets.widgets.dap.lmfit_dialog.lmfit_dialog import LMFitDialog -from .client_mocks import mocked_client from .conftest import create_widget diff --git a/tests/unit_tests/test_logpanel.py b/tests/unit_tests/test_logpanel.py index b9d20731..e48db688 100644 --- a/tests/unit_tests/test_logpanel.py +++ b/tests/unit_tests/test_logpanel.py @@ -18,8 +18,6 @@ from bec_widgets.widgets.utility.logpanel._util import ( ) from bec_widgets.widgets.utility.logpanel.logpanel import DEFAULT_LOG_COLORS, LogPanel -from .client_mocks import mocked_client - TEST_TABLE_STRING = "2025-01-15 15:57:18 | bec_server.scan_server.scan_queue | [INFO] | \n \x1b[3m primary queue / ScanQueueStatus.RUNNING \x1b[0m\n┏━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━┳━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━┓\n┃\x1b[1m \x1b[0m\x1b[1m queue_id \x1b[0m\x1b[1m \x1b[0m┃\x1b[1m \x1b[0m\x1b[1mscan_id\x1b[0m\x1b[1m \x1b[0m┃\x1b[1m \x1b[0m\x1b[1mis_scan\x1b[0m\x1b[1m \x1b[0m┃\x1b[1m \x1b[0m\x1b[1mtype\x1b[0m\x1b[1m \x1b[0m┃\x1b[1m \x1b[0m\x1b[1mscan_numb…\x1b[0m\x1b[1m \x1b[0m┃\x1b[1m \x1b[0m\x1b[1mIQ status\x1b[0m\x1b[1m \x1b[0m┃\n┡━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━╇━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━┩\n│ bbe50c82-6… │ None │ False │ mv │ None │ PENDING │\n└─────────────┴─────────┴─────────┴──────┴────────────┴───────────┘\n\n" TEST_LOG_MESSAGES = [ diff --git a/tests/unit_tests/test_main_app.py b/tests/unit_tests/test_main_app.py index 3d3a42f1..1d85b542 100644 --- a/tests/unit_tests/test_main_app.py +++ b/tests/unit_tests/test_main_app.py @@ -4,8 +4,6 @@ from qtpy.QtWidgets import QWidget from bec_widgets.applications.main_app import BECMainApp from bec_widgets.applications.views.view import ViewBase -from .client_mocks import mocked_client - ANIM_TEST_DURATION = 60 # ms diff --git a/tests/unit_tests/test_main_widnow.py b/tests/unit_tests/test_main_widnow.py index ee0c1309..7dac6482 100644 --- a/tests/unit_tests/test_main_widnow.py +++ b/tests/unit_tests/test_main_widnow.py @@ -13,7 +13,6 @@ from bec_widgets.widgets.containers.main_window.addons.scroll_label import Scrol from bec_widgets.widgets.containers.main_window.addons.web_links import BECWebLinksMixin from bec_widgets.widgets.containers.main_window.main_window import BECMainWindow -from .client_mocks import mocked_client from .conftest import create_widget diff --git a/tests/unit_tests/test_monaco_dock.py b/tests/unit_tests/test_monaco_dock.py index 0a1d6b88..dcca1fd4 100644 --- a/tests/unit_tests/test_monaco_dock.py +++ b/tests/unit_tests/test_monaco_dock.py @@ -8,8 +8,6 @@ from qtpy.QtWidgets import QFileDialog, QMessageBox from bec_widgets.widgets.editors.monaco.monaco_dock import MonacoDock from bec_widgets.widgets.editors.monaco.monaco_widget import MonacoWidget -from .client_mocks import mocked_client - @pytest.fixture def monaco_dock(qtbot, mocked_client) -> Generator[MonacoDock, None, None]: diff --git a/tests/unit_tests/test_monaco_editor.py b/tests/unit_tests/test_monaco_editor.py index f0b39506..484283bc 100644 --- a/tests/unit_tests/test_monaco_editor.py +++ b/tests/unit_tests/test_monaco_editor.py @@ -7,7 +7,6 @@ from bec_widgets.utils.widget_io import WidgetIO from bec_widgets.widgets.editors.monaco.monaco_widget import MonacoWidget from bec_widgets.widgets.editors.monaco.scan_control_dialog import ScanControlDialog -from .client_mocks import mocked_client from .test_scan_control import available_scans_message diff --git a/tests/unit_tests/test_motor_map_next_gen.py b/tests/unit_tests/test_motor_map_next_gen.py index 4e296f63..918e66ea 100644 --- a/tests/unit_tests/test_motor_map_next_gen.py +++ b/tests/unit_tests/test_motor_map_next_gen.py @@ -1,7 +1,6 @@ from qtpy.QtTest import QSignalSpy from bec_widgets.widgets.plots.motor_map.motor_map import MotorMap -from tests.unit_tests.client_mocks import mocked_client from .conftest import create_widget diff --git a/tests/unit_tests/test_multi_waveform_next_gen.py b/tests/unit_tests/test_multi_waveform_next_gen.py index 0b7ae96f..2883995b 100644 --- a/tests/unit_tests/test_multi_waveform_next_gen.py +++ b/tests/unit_tests/test_multi_waveform_next_gen.py @@ -1,7 +1,6 @@ import numpy as np from bec_widgets.widgets.plots.multi_waveform.multi_waveform import MultiWaveform -from tests.unit_tests.client_mocks import mocked_client from .conftest import create_widget diff --git a/tests/unit_tests/test_notifications.py b/tests/unit_tests/test_notifications.py index 3ef5f5a3..3798dd18 100644 --- a/tests/unit_tests/test_notifications.py +++ b/tests/unit_tests/test_notifications.py @@ -13,8 +13,6 @@ from bec_widgets.widgets.containers.main_window.addons.notification_center.notif SeverityKind, ) -from .client_mocks import mocked_client - @pytest.fixture def toast(qtbot): diff --git a/tests/unit_tests/test_pdf_viewer.py b/tests/unit_tests/test_pdf_viewer.py index 80da6075..e3300474 100644 --- a/tests/unit_tests/test_pdf_viewer.py +++ b/tests/unit_tests/test_pdf_viewer.py @@ -4,8 +4,6 @@ from qtpy.QtPdfWidgets import QPdfView from bec_widgets.widgets.utility.pdf_viewer.pdf_viewer import PdfViewerWidget -from .client_mocks import mocked_client - @pytest.fixture def pdf_viewer_widget(qtbot, mocked_client): diff --git a/tests/unit_tests/test_plot_base_next_gen.py b/tests/unit_tests/test_plot_base_next_gen.py index c1918d65..a81f68f3 100644 --- a/tests/unit_tests/test_plot_base_next_gen.py +++ b/tests/unit_tests/test_plot_base_next_gen.py @@ -2,7 +2,6 @@ import numpy as np from bec_widgets.widgets.plots.plot_base import PlotBase, UIMode -from .client_mocks import mocked_client from .conftest import create_widget # pylint: disable=unused-import diff --git a/tests/unit_tests/test_positioner_box.py b/tests/unit_tests/test_positioner_box.py index 531a494e..e6bff8f6 100644 --- a/tests/unit_tests/test_positioner_box.py +++ b/tests/unit_tests/test_positioner_box.py @@ -16,7 +16,6 @@ from bec_widgets.widgets.control.device_input.device_line_edit.device_line_edit DeviceLineEdit, ) -from .client_mocks import mocked_client from .conftest import create_widget diff --git a/tests/unit_tests/test_positioner_box_2d.py b/tests/unit_tests/test_positioner_box_2d.py index 40535ab0..c570e62a 100644 --- a/tests/unit_tests/test_positioner_box_2d.py +++ b/tests/unit_tests/test_positioner_box_2d.py @@ -4,7 +4,6 @@ import pytest from bec_widgets.widgets.control.device_control.positioner_box import PositionerBox2D -from .client_mocks import mocked_client from .conftest import create_widget diff --git a/tests/unit_tests/test_reset_button.py b/tests/unit_tests/test_reset_button.py index 1d0836c9..96d762c4 100644 --- a/tests/unit_tests/test_reset_button.py +++ b/tests/unit_tests/test_reset_button.py @@ -7,8 +7,6 @@ from qtpy.QtWidgets import QMessageBox from bec_widgets.widgets.control.buttons.button_reset.button_reset import ResetButton -from .client_mocks import mocked_client - @pytest.fixture def reset_button(qtbot, mocked_client): diff --git a/tests/unit_tests/test_resume_button.py b/tests/unit_tests/test_resume_button.py index b080ab60..5b1aa08c 100644 --- a/tests/unit_tests/test_resume_button.py +++ b/tests/unit_tests/test_resume_button.py @@ -4,8 +4,6 @@ import pytest from bec_widgets.widgets.control.buttons.button_resume.button_resume import ResumeButton -from .client_mocks import mocked_client - @pytest.fixture def resume_button(qtbot, mocked_client): diff --git a/tests/unit_tests/test_ring_progress_bar.py b/tests/unit_tests/test_ring_progress_bar.py index e858e80d..9595475c 100644 --- a/tests/unit_tests/test_ring_progress_bar.py +++ b/tests/unit_tests/test_ring_progress_bar.py @@ -10,8 +10,6 @@ from qtpy.QtGui import QColor from bec_widgets.utils import Colors from bec_widgets.widgets.progress.ring_progress_bar.ring_progress_bar import RingProgressBar -from .client_mocks import mocked_client - @pytest.fixture def ring_progress_bar(qtbot, mocked_client): diff --git a/tests/unit_tests/test_ring_progress_bar_ring.py b/tests/unit_tests/test_ring_progress_bar_ring.py index d3437b8d..892ec12c 100644 --- a/tests/unit_tests/test_ring_progress_bar_ring.py +++ b/tests/unit_tests/test_ring_progress_bar_ring.py @@ -11,8 +11,6 @@ from bec_widgets.widgets.progress.ring_progress_bar.ring_progress_bar import ( RingProgressContainerWidget, ) -from .client_mocks import mocked_client - @pytest.fixture def ring_container(qtbot, mocked_client): diff --git a/tests/unit_tests/test_ring_progress_settings.py b/tests/unit_tests/test_ring_progress_settings.py index 341e7ade..a8e1dadc 100644 --- a/tests/unit_tests/test_ring_progress_settings.py +++ b/tests/unit_tests/test_ring_progress_settings.py @@ -3,7 +3,6 @@ import pytest from bec_widgets.utils.settings_dialog import SettingsDialog from bec_widgets.widgets.progress.ring_progress_bar.ring_progress_bar import RingProgressBar from bec_widgets.widgets.progress.ring_progress_bar.ring_progress_settings_cards import RingSettings -from tests.unit_tests.client_mocks import mocked_client @pytest.fixture diff --git a/tests/unit_tests/test_rpc_server.py b/tests/unit_tests/test_rpc_server.py index b4ecf906..f6cb2c14 100644 --- a/tests/unit_tests/test_rpc_server.py +++ b/tests/unit_tests/test_rpc_server.py @@ -9,8 +9,6 @@ from bec_widgets.cli.server import GUIServer from bec_widgets.utils.bec_connector import BECConnector from bec_widgets.utils.rpc_server import RegistryNotReadyError, RPCServer, SingleshotRPCRepeat -from .client_mocks import mocked_client - class DummyWidget(BECConnector, QWidget): def __init__(self, parent=None, client=None, **kwargs): diff --git a/tests/unit_tests/test_scan_control.py b/tests/unit_tests/test_scan_control.py index 75f48af1..6262c668 100644 --- a/tests/unit_tests/test_scan_control.py +++ b/tests/unit_tests/test_scan_control.py @@ -11,8 +11,6 @@ from bec_widgets.utils.forms_from_types.items import StrFormItem from bec_widgets.utils.widget_io import WidgetIO from bec_widgets.widgets.control.scan_control import ScanControl -from .client_mocks import mocked_client - # pylint: disable=no-member # pylint: disable=missing-function-docstring # pylint: disable=redefined-outer-name diff --git a/tests/unit_tests/test_scan_history_browser.py b/tests/unit_tests/test_scan_history_browser.py index 4ddf24e7..3c273d14 100644 --- a/tests/unit_tests/test_scan_history_browser.py +++ b/tests/unit_tests/test_scan_history_browser.py @@ -15,8 +15,6 @@ from bec_widgets.widgets.services.scan_history_browser.scan_history_browser impo ScanHistoryBrowser, ) -from .client_mocks import mocked_client - @pytest.fixture def scan_history_msg(): diff --git a/tests/unit_tests/test_scan_progress_bar.py b/tests/unit_tests/test_scan_progress_bar.py index 3a5b4b56..8e27f775 100644 --- a/tests/unit_tests/test_scan_progress_bar.py +++ b/tests/unit_tests/test_scan_progress_bar.py @@ -14,8 +14,6 @@ from bec_widgets.widgets.progress.scan_progressbar.scan_progressbar import ( ScanProgressBar, ) -from .client_mocks import mocked_client - @pytest.fixture def scan_progressbar(qtbot, mocked_client): diff --git a/tests/unit_tests/test_scatter_waveform.py b/tests/unit_tests/test_scatter_waveform.py index 3a8abcf3..445aeb52 100644 --- a/tests/unit_tests/test_scatter_waveform.py +++ b/tests/unit_tests/test_scatter_waveform.py @@ -10,7 +10,6 @@ from bec_widgets.widgets.plots.scatter_waveform.scatter_waveform import ScatterW from bec_widgets.widgets.plots.scatter_waveform.settings.scatter_curve_setting import ( ScatterCurveSettings, ) -from tests.unit_tests.client_mocks import create_dummy_scan_item, mocked_client from .conftest import create_widget diff --git a/tests/unit_tests/test_signal_label.py b/tests/unit_tests/test_signal_label.py index 38df89b3..3886cc8b 100644 --- a/tests/unit_tests/test_signal_label.py +++ b/tests/unit_tests/test_signal_label.py @@ -11,8 +11,6 @@ from bec_widgets.widgets.control.device_input.base_classes.device_signal_input_b ) from bec_widgets.widgets.utility.signal_label.signal_label import ChoiceDialog, SignalLabel -from .client_mocks import mocked_client - SAMX_INFO_DICT = { "signals": { "readback": { diff --git a/tests/unit_tests/test_stop_button.py b/tests/unit_tests/test_stop_button.py index e428a7de..8daa6eb9 100644 --- a/tests/unit_tests/test_stop_button.py +++ b/tests/unit_tests/test_stop_button.py @@ -4,8 +4,6 @@ import pytest from bec_widgets.widgets.control.buttons.stop_button.stop_button import StopButton -from .client_mocks import mocked_client - @pytest.fixture def stop_button(qtbot, mocked_client): diff --git a/tests/unit_tests/test_text_box_widget.py b/tests/unit_tests/test_text_box_widget.py index 65f0f719..a90a4396 100644 --- a/tests/unit_tests/test_text_box_widget.py +++ b/tests/unit_tests/test_text_box_widget.py @@ -2,8 +2,6 @@ import pytest from bec_widgets.widgets.editors.text_box.text_box import DEFAULT_TEXT, TextBox -from .client_mocks import mocked_client - @pytest.fixture def text_box_widget(qtbot, mocked_client): diff --git a/tests/unit_tests/test_utils_bec_signal_proxy.py b/tests/unit_tests/test_utils_bec_signal_proxy.py index e8fd50fb..59140b49 100644 --- a/tests/unit_tests/test_utils_bec_signal_proxy.py +++ b/tests/unit_tests/test_utils_bec_signal_proxy.py @@ -6,7 +6,6 @@ import pytest from bec_widgets.utils.bec_signal_proxy import BECSignalProxy from bec_widgets.widgets.dap.dap_combo_box.dap_combo_box import DapComboBox -from .client_mocks import mocked_client from .conftest import create_widget diff --git a/tests/unit_tests/test_utils_plot_indicators.py b/tests/unit_tests/test_utils_plot_indicators.py index c156bb38..e5dbcbc5 100644 --- a/tests/unit_tests/test_utils_plot_indicators.py +++ b/tests/unit_tests/test_utils_plot_indicators.py @@ -3,8 +3,6 @@ from qtpy.QtCore import QPointF from bec_widgets.widgets.plots.waveform.waveform import Waveform -from .client_mocks import mocked_client - @pytest.fixture def plot_widget_with_arrow_item(qtbot, mocked_client): diff --git a/tests/unit_tests/test_waveform.py b/tests/unit_tests/test_waveform.py index 142b0e73..240c3e7a 100644 --- a/tests/unit_tests/test_waveform.py +++ b/tests/unit_tests/test_waveform.py @@ -18,14 +18,6 @@ from bec_widgets.widgets.plots.waveform.waveform import Waveform from bec_widgets.widgets.services.scan_history_browser.scan_history_browser import ( ScanHistoryBrowser, ) -from tests.unit_tests.client_mocks import ( - DummyData, - create_dummy_scan_item, - dap_plugin_message, - inject_scan_history, - mocked_client, - mocked_client_with_dap, -) from .conftest import create_widget diff --git a/tests/unit_tests/test_web_console.py b/tests/unit_tests/test_web_console.py index c27eb516..5e04ad63 100644 --- a/tests/unit_tests/test_web_console.py +++ b/tests/unit_tests/test_web_console.py @@ -12,8 +12,6 @@ from bec_widgets.widgets.editors.web_console.web_console import ( _web_console_registry, ) -from .client_mocks import mocked_client - @pytest.fixture def mocked_server_startup(): diff --git a/tests/unit_tests/test_website_widget.py b/tests/unit_tests/test_website_widget.py index 83909474..177f4a0a 100644 --- a/tests/unit_tests/test_website_widget.py +++ b/tests/unit_tests/test_website_widget.py @@ -3,8 +3,6 @@ from qtpy.QtCore import QUrl from bec_widgets.widgets.editors.website.website import WebsiteWidget -from .client_mocks import mocked_client - @pytest.fixture def website_widget(qtbot, mocked_client):