Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 9, 2024
1 parent 3f235c1 commit 9ed9c1b
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 15 deletions.
1 change: 1 addition & 0 deletions src/snapred/backend/dao/indexing/Versioning.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from pydantic import BaseModel, ConfigDict, field_validator

from snapred.meta.Config import Config
from snapred.meta.Enum import StrEnum

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/meta/test_Decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def setText(self, text):
self.text = text


@pytest.mark.ui()
@pytest.mark.ui
def test_resettable(qtbot):
parent = QWidget()
qtbot.addWidget(parent)
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/ui/presenter/test_InitializeStatePresenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def setup_view_and_workflow():
return view, workflow


@pytest.mark.ui()
@pytest.mark.ui
def test_handleButtonClicked_with_valid_input(setup_view_and_workflow):
view, workflow = setup_view_and_workflow
view.getRunNumber.return_value = "12345"
Expand All @@ -43,7 +43,7 @@ def test_handleButtonClicked_with_valid_input(setup_view_and_workflow):
mock_initializeState.assert_called_once_with("12345", "Test State", True)


@pytest.mark.ui()
@pytest.mark.ui
def test_handleButtonClicked_with_invalid_input(setup_view_and_workflow):
view, workflow = setup_view_and_workflow
view.getRunNumber.return_value = "invalid"
Expand All @@ -53,7 +53,7 @@ def test_handleButtonClicked_with_invalid_input(setup_view_and_workflow):
mock_warning.assert_called_once()


@pytest.mark.ui()
@pytest.mark.ui
def test__initializeState(setup_view_and_workflow):
view, workflow = setup_view_and_workflow
view.getRunNumber.return_value = "12345"
Expand All @@ -69,7 +69,7 @@ def test__initializeState(setup_view_and_workflow):
mock_dialog_showSuccess.assert_called_once()


@pytest.mark.ui()
@pytest.mark.ui
def test__handleResponse_error(setup_view_and_workflow):
view, workflow = setup_view_and_workflow
error_response = SNAPResponse(code=ResponseCode.ERROR, message="Error message")
Expand All @@ -82,7 +82,7 @@ def test__handleResponse_error(setup_view_and_workflow):
mock_critical.assert_called_once()


@pytest.mark.ui()
@pytest.mark.ui
def test__handleResponse_success(setup_view_and_workflow):
view, workflow = setup_view_and_workflow
success_response = SNAPResponse(code=ResponseCode.OK)
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/ui/view/test_CalibrationAssessmentView.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from unittest.mock import MagicMock

import pytest

from snapred.backend.dao.indexing.IndexEntry import IndexEntry
from snapred.ui.view.DiffCalAssessmentView import DiffCalAssessmentView


@pytest.mark.ui()
@pytest.mark.ui
def test_calibration_record_dropdown(qtbot):
view = DiffCalAssessmentView()
assert view.getCalibrationRecordCount() == 0
Expand All @@ -28,7 +29,7 @@ def test_calibration_record_dropdown(qtbot):
assert view.getSelectedCalibrationRecordData() == (runNumber, useLiteMode, version)


@pytest.mark.ui()
@pytest.mark.ui
def test_error_on_load_calibration_record(qtbot):
view = DiffCalAssessmentView()
qtbot.addWidget(view.loadButton)
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/ui/view/test_InitializeStateCheckView.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import pytest

from snapred.ui.view.InitializeStateCheckView import InitializationMenu


@pytest.mark.ui()
@pytest.mark.ui
def test_run_number_field(qtbot):
menu = InitializationMenu(None)
qtbot.addWidget(menu)
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/ui/widget/test_Workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def continueAction(workflowPresenter): # noqa: ARG001
return WorkflowBuilder().addNode(continueAction, view, "Test").build()


@pytest.mark.ui()
@pytest.mark.ui
def test_workflowPresenterHandleContinueButtonClicked(qtbot):
# Mock the worker pool
mockWorkerPool = MagicMock()
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/ui/workflow/test_DiffCalWorkflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from snapred.ui.workflow.DiffCalWorkflow import DiffCalWorkflow


@pytest.mark.ui()
@pytest.mark.ui
@patch("snapred.ui.workflow.DiffCalWorkflow.WorkflowImplementer.request")
def test_purge_bad_peaks(workflowRequest, qtbot): # noqa: ARG001
"""
Expand Down Expand Up @@ -66,7 +66,7 @@ def test_purge_bad_peaks(workflowRequest, qtbot): # noqa: ARG001
)


@pytest.mark.ui()
@pytest.mark.ui
@patch("snapred.ui.workflow.DiffCalWorkflow.WorkflowImplementer.request")
def test_purge_bad_peaks_two_wkspindex(workflowRequest, qtbot): # noqa: ARG001
"""
Expand Down Expand Up @@ -128,7 +128,7 @@ def test_purge_bad_peaks_two_wkspindex(workflowRequest, qtbot): # noqa: ARG001
)


@pytest.mark.ui()
@pytest.mark.ui
@patch("snapred.ui.workflow.DiffCalWorkflow.WorkflowImplementer.request")
def test_purge_bad_peaks_too_few(workflowRequest, qtbot): # noqa: ARG001
"""
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/ui/workflow/test_WorkflowImplementer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from snapred.ui.workflow.WorkflowImplementer import WorkflowImplementer


@pytest.mark.ui()
@pytest.mark.ui
def test_rename_on_iterate_list(qtbot): # noqa: ARG001
"""
Test that on iteration, a list of workspaces will be renamed according to the iteration template.
Expand All @@ -26,7 +26,7 @@ def test_rename_on_iterate_list(qtbot): # noqa: ARG001
assert instance.collectedOutputs == newNames


@pytest.mark.ui()
@pytest.mark.ui
def test_rename_on_iterate_group(qtbot): # noqa: ARG001
"""
Test that on iteration, a workspace group has all of its members renamed.
Expand Down

0 comments on commit 9ed9c1b

Please sign in to comment.