diff --git a/tests/unit_tests/test_scan_control.py b/tests/unit_tests/test_scan_control.py index 4986e403..a70032cc 100644 --- a/tests/unit_tests/test_scan_control.py +++ b/tests/unit_tests/test_scan_control.py @@ -509,6 +509,9 @@ def test_scan_selection_does_not_fetch_last_scan_parameters( xread = MagicMock(wraps=mocked_client.connector.xread) monkeypatch.setattr(mocked_client.connector, "xread", xread) + scan_control.comboBox_scan_selection.setCurrentText("line_scan") + assert scan_control.comboBox_scan_selection.currentText() == "line_scan" + scan_control.comboBox_scan_selection.setCurrentText("grid_scan") xread.assert_not_called() @@ -517,10 +520,13 @@ def test_scan_selection_does_not_fetch_last_scan_parameters( def test_restore_last_scan_parameters_button_fetches_on_demand( scan_control, mocked_client, qtbot, monkeypatch ): - scan_control.comboBox_scan_selection.setCurrentText("line_scan") xread = MagicMock(wraps=mocked_client.connector.xread) monkeypatch.setattr(mocked_client.connector, "xread", xread) + scan_control.comboBox_scan_selection.setCurrentText("grid_scan") + scan_control.comboBox_scan_selection.setCurrentText("line_scan") + xread.assert_not_called() + qtbot.mouseClick(scan_control.last_scan_button, Qt.LeftButton) xread.assert_called_once_with( @@ -533,12 +539,13 @@ def test_restore_last_scan_parameters_button_fetches_on_demand( assert kwargs["exp_time"] == 2 -@pytest.mark.skip(reason="Unreliable - GH issue #1134") -def test_get_scan_parameters_from_redis(scan_control, mocked_client): +# @pytest.mark.skip(reason="Unreliable - GH issue #1134") +def test_get_scan_parameters_from_redis(scan_control, mocked_client, qtbot): scan_name = "line_scan" scan_control.comboBox_scan_selection.setCurrentText(scan_name) scan_control.last_scan_button.click() + qtbot.wait(200) args, kwargs = scan_control.get_scan_parameters(bec_object=False) @@ -618,7 +625,7 @@ def test_scan_metadata_is_passed_to_scan_function(scan_control: ScanControl): scans.grid_scan.assert_called_once_with(metadata=TEST_MD) -@pytest.mark.skip(reason="Unreliable - GH issue #1134") +# @pytest.mark.skip(reason="Unreliable - GH issue #1134") def test_restore_parameters_with_fewer_arg_bundles(scan_control, qtbot): """ Ensure that when more argument bundles are present than exist in the