Skip to content

Commit

Permalink
Use QComboBox.isChecked rather than QCombox.checkState
Browse files Browse the repository at this point in the history
The latter is for tristate checkboxes
  • Loading branch information
p-j-smith committed Aug 1, 2023
1 parent 8f07b29 commit beacb80
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/napari/test_dock_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,19 @@ def test_reset_button(track_widget):
"""Tests that clicking the reset button restores the default config values"""

original_max_search_radius = track_widget.max_search_radius.value()
original_relax = track_widget.relax.checkState()
original_relax = track_widget.relax.isChecked()

# change some widget values
track_widget.max_search_radius.setValue(
track_widget.max_search_radius.value() + 10
)
track_widget.relax.setChecked(not track_widget.relax.checkState())
track_widget.relax.setChecked(not track_widget.relax.isChecked())

# click reset button - restores defaults of the currently-selected base config
track_widget.reset_button.click()

new_max_search_radius = track_widget.max_search_radius.value()
new_relax = track_widget.relax.checkState()
new_relax = track_widget.relax.isChecked()

assert new_max_search_radius == original_max_search_radius
assert new_relax == original_relax
Expand Down

0 comments on commit beacb80

Please sign in to comment.